Announcement Announcement Module
Collapse
No announcement yet.
OAuth Login Configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OAuth Login Configuration

    Hi Spring - Community,

    I�m trying to develop my own oauth provider, which should be used by an android client, with the aid of the greenhouse application. If tried to get familiar with the greenhouse android client and the greenhouse web application. After this, the first step, was to include the source code of greenhouse in our webapplication. This works fine. But trying to connect to the our webapplication via the android client does not work. The client makes a request with an appkey and an app object is build. after this, the client redirects my to our login page, which is configured like this:

    Code:
    <security:http auto-config='true' access-denied-page="/accessDenied.html">
    		<security:intercept-url pattern="/**" access="ROLE_STANDARD" />
    		<security:form-login login-page="/login.html" 
    			authentication-failure-url="/login_error.html" default-target-url="/pages/start/start.html"
    			always-use-default-target="true" />
    
    		<security:logout logout-success-url="/login.html"
    			invalidate-session="true" />
    		<security:session-management>
    	        <security:concurrency-control max-sessions="1" />
    	    </security:session-management>	
    	</security:http>
    	
    	<security:authentication-manager alias="authenticationManager">
    		 <security:authentication-provider
    			user-service-ref="userDetailsServiceImpl">
    			<security:password-encoder hash="md5" />
    		</security:authentication-provider> 
    	</security:authentication-manager>

    and looks like this:

    Code:
    <form accept-charset="utf-8" method="post" action="j_spring_security_check" name="logForm" >
    					
    					<div style="margin-bottom: 10px;">
    					<input name="j_username1" value="#{msg.text_userName}" 
    						onkeydown="if(event.keyCode=='13') event.keyCode=9;" type="text" size="18" style="margin-right:5px"  
    						onfocus="if(value=='#{msg.text_userName}')value=''" 
    						onblur="if(value=='')value='#{msg.text_userName}'" class="float_left" 
    						tabindex="1" />
    					<input name="j_password" type="password" value="#{msg.text_password}" 
    						onkeydown="if(event.keyCode=='13'){ concatenateUrlToUsername(); document.forms.logForm.submit();}" size="16"  class="go_right " 
    						onfocus="if(value=='#{msg.text_password}')value=''" 
    						onblur="if(value=='')value='#{msg.text_password}'"
    						tabindex="2" />
    					<input name="j_redirecturl" value="/login.html" type="hidden" />
    					<input name="j_username" value="" type="hidden" />
    					<div class="clearall" />
    					</div>
    					<div class="go_right submit-button"> 
    						<span> 
    						<em>
    							<a onclick="concatenateUrlToUsername(); document.forms.logForm.submit()" 
                                                            onkeydown="if(event.keyCode=='13'){ makeLowerCaseUserName(); document.forms.logForm.submit();}"
                                                            
    							tabindex="3" accesskey="l">Login</a>
    						</em> 
    						</span> 
    					</div>
    					<a href="password_forgotten.html" class="link_text go_right" style="margin-right: 15px">#{msg.text_pass_forgotten}</a>
    	            </form>
    This works fine, but giving the user credentials and pressing the login button has no effect. I�ve tried to debugg the webapplication including the sources of spring security and oauth. In the greenhouse sample application the signincontroller and the usernamePasswordAuthenticationProvider are called:

    Code:
    @Controller
    public class SigninController {
    	
    	/**
    	 * Render the signin form to the person as HTML in their web browser.
    	 * Returns void and relies in request-to-view-name translation to kick-in to resolve the view template to render.
    	 */
    	@RequestMapping(value="/signin", method=RequestMethod.GET)
    	public void signin() {
    		System.out.println("signin");
    	}
    }
    But in our application it isn�t. My question is, what do I have to configure that our login page calls these classes to fullfill the authentication process?

    Greetings
    Asuka
Working...
X