Announcement Announcement Module
No announcement yet.
Return user to original target after Registration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Return user to original target after Registration

    I'm new to Spring Security and generally like what I see, but I'm stumped as to how to do what I think is a fairly common thing. We've got a site where we want people to register with us to get to our password-protected content. They could follow this path:
    1. They try to get to protected content;
    2. Spring Security routes them to a login form;
    3. Login form contains a link to 'Register'.
    4. Registration has a sequence of a couple pages;
    5. Registration succeeds...

    ... and here's the problem. How do I send them back to the page that they were trying to get to when they first got diverted?

    It seems like SS must have this somewhere accessible since it uses it after the user has authenticated. But where is it, and how do I get to it, particularly if it's been a few pages/requests away for a user diverted to the registration process.

    Any help would be appreciated.


  • #2
    Rolled my own

    For what it's worth, I handled this by adding a query arg named 'targetUrl' to my links to the Registration page, and adjusted the registration to pick that up and send the user to it once they successfully finished our registration process. Maybe there's a way to do that within Spring Security, but I couldn't find it.