Announcement Announcement Module
No announcement yet.
Custom login controller in spring security oauth sparklr2 example Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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 access-denied-page="/login.jsp?authorization_error=true"
    		disable-url-rewriting="true" xmlns="">
    		<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="/" />
    		<logout logout-success-url="/index.jsp" logout-url="/" />
    		<anonymous />
    there's no @Controller with an @RequestMapping set to "" 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="/" />

    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, 05: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"?


    • #3
      thanks a lot.

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

      thanks again for your time!