Announcement Announcement Module
Collapse
No announcement yet.
Custom login controller in spring security oauth sparklr2 example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:28 AM. Reason: added extra info

  • #2
    Sparklr2 is already <mvc:annotation-driven /> by default. Did you add a bean definition for your "stupid controller"?

    Comment


    • #3
      thanks a lot.

      i thought i had context:component-scan but i did not.

      thanks again for your time!

      Comment

      Working...
      X