Results 1 to 2 of 2

Thread: Retain Original Target URL with always-use-default-target="true"

  1. #1
    Join Date
    Jun 2010
    Posts
    7

    Default Retain Original Target URL with always-use-default-target="true"

    Hello,

    I have a situation in which I would like to retain the original target URL that the user requested, but my config contains always-use-default-target="true". I am forwarding to a default target to do some post-login processing, however, I would like to then, continue on to the original target.

    I've tried inserting some custom filters to capture the original target (similar to Spring's RequestCache.saveRequest) but after successful login, the original session is destroyed and a new session is created because of session-fixation-protection (which I still want).

    Here is my current setup:

    Code:
    <security:http auto-config="true" access-denied-page="/accessDenied" >
    		<security:intercept-url pattern="/secure/**" access="ROLE_USER" requires-channel="https"/>		<security:intercept-url pattern="/resources/**" filters="none" /> 		<security:intercept-url pattern="/login*" filters="none" />
    		<security:intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN" />
    		<security:form-login login-page='/login' authentication-failure-url="/login?login_error=1"
    			default-target-url="/postLogin" always-use-default-target="true"/>
    		<security:logout logout-success-url="/home"/>
    		<security:session-management session-fixation-protection="newSession">
    			<security:concurrency-control max-sessions="1"/>
    		</security:session-management>
    	</security:http>
    The default-target-url="/postLogin" is mapping to a controller that is doing some processing and then sends to a view - this is where I'd like to grab the original target from the session and forward to it.

    Is there a better way I can do this or something else I can override to accomplish this?

    Any help is much appreciated,
    Mark

  2. #2
    Join Date
    Jun 2010
    Posts
    7

    Default

    I got it.

    After reviewing my question, i saw that I still had session-fixation-protection="newSession" instead of "migrateSession" from earlier debugging.

    Doh!

Posting Permissions

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