Results 1 to 3 of 3

Thread: Custom login controller in spring security oauth sparklr2 example

Threaded View

  1. #1
    Join Date
    Oct 2009
    Location
    Milano
    Posts
    49

    Default Custom login controller in spring security oauth sparklr2 example

    I'm trying to set up my oauth provider using the sparklr2 example.
    it's working fine but now i have to customize the login form controller.

    this is what i have (http://bit.ly/OJuNYI)
    Code:
    <http access-denied-page="/login.jsp?authorization_error=true"
    		disable-url-rewriting="true" xmlns="http://www.springframework.org/schema/security">
    		<intercept-url pattern="/oauth/**" access="ROLE_USER" />
    		<intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
    
    		<form-login authentication-failure-url="/login.jsp?authentication_error=true"
    			default-target-url="/index.jsp" login-page="/login.jsp"
    			login-processing-url="/login.do" />
    		<logout logout-success-url="/index.jsp" logout-url="/logout.do" />
    		<anonymous />
    	</http>
    there's no @Controller with an @RequestMapping set to "login.do" so it's kinda working auto-magically, so to speak.

    I decided I was just gonna create my own LoginController that would do my things connected to /login url.

    So i have now

    <form-login authentication-failure-url="/login?authentication_error=true"
    default-target-url="/index.jsp" login-page="/login"
    login-processing-url="/login.do" />

    and later

    <mvc:annotation-driven />

    here's the stupid controller

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String login() throws Exception {
    return "mylogin";
    }


    it's not working.

    Log correctly says RequestMappingHandlerMapping.getHandlerInternal Did not find handler method for [/login]


    what am i missing?
    Last edited by mfirry; Jul 26th, 2012 at 05:28 AM. Reason: added extra info
    2+2=5

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •