Announcement Announcement Module
No announcement yet.
Unable to reach controller after spring security has authenticated Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to reach controller after spring security has authenticated

    I am having some issues with the authentication process. I am using a pre auth filter that extends the AbstractAuthenticationProcessingFilter class. I am overriding the attemptAuthentication and requiresAuthentication methods. The attemptAuthenication is working as expected validating user data submitted from a client and generating a security token.

    The issue I have is after the authentication is complete I am not getting to the controller method and am receiving back a 404 not found response. If I turn off security I can reach the controller. What could the problem be?

    Here is some of my security configuration
    <sec:http create-session="stateless" pattern="/private/**" entry-point-ref="http403ForbiddenEntryPoint" 
    			<sec:port-mapping http="8080" https="8081"/>
    		<sec:intercept-url pattern="/private/auth" access="IS_AUTHENTICATED_ANONYMOUSLY" requires-channel="any" />
    		<sec:intercept-url pattern="/private/secure/**" access="ROLE_OPERATOR" requires-channel="any"/>
    		<sec:custom-filter position="PRE_AUTH_FILTER" ref="authFilter"/>
    <bean id="authFilter" class="...AuthFilter">
    		<property name="authenticationManager" ref="authManager" />
    	<sec:authentication-manager id="authManager">
    		<sec:authentication-provider ref="authProvider" /> 

    Here are some logs after authentication is complete rategy ( - Redirecting to '/testapp/' ontextPersistenceFilter ( - SecurityContextHolder now cleared, as request processing completed stMatcher ( - Checking match of request : '/'; against '/private/**' ( - / has no matching filters

    org.springframework.web.servlet.DispatcherServlet ( - DispatcherServlet with name 'start' processing GET request for [/testapp/]

    org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerMapping ( - Looking up handler method for path /

    org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerMapping ( - Did not find handler method for [/]

    org.springframework.web.servlet.PageNotFound ( - No mapping found for HTTP request with URI [/test/] in DispatcherServlet with name 'start'