Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Redirect to original page after login success/failure

  1. #11
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    Quote Originally Posted by anoop nair View Post
    i didnt get the part about it being protected...
    You have a security constraint which prevents it from being accessed unless the user has the role "ROLE_USER". You need to understand the basics before you try to customize things. Does your filter actually handle the URL "/loginURL"? If not, then the request will be rejected because of the security constraint. If it does, then the security constraint serves no purpose. In fact, it servers no puspose in any case, since only anonymous users should be submitting a login form.

    The forum uses the referer header as I suggested above.
    Spring - by Pivotal
    twitter @tekul

  2. #12

    Thumbs up Solved.

    Hi Luke,

    Thanks for your suggestion. My filter was not actually handling the url....

    I added the following line to my filter bean and now it works.
    Code:
    <property name="filterProcessesUrl" value="/loginURL"></property>
    My filter bean now looks like
    Code:
    <bean id="authenticationProcessingFilter" class="com.myapp.authentication.CustomAuthenticationProcessingFilter">
        <security:custom-filter position="AUTHENTICATION_PROCESSING_FILTER" />
        <property name="defaultTargetUrl" value="/general/home" />
        <property name="authenticationManager" ref="authenticationManager" />
        <property name="filterProcessesUrl" value="/loginURL"></property>
      </bean>

    Also in my AuthenticationProcessingFilter I am overriding determineTargetUrl method to redirect to the referer....

    however.... if i remove "ROLE_USER" from my security:http intercept-url element it doesnt work.

Posting Permissions

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