Results 1 to 2 of 2

Thread: Updating Session's Authentication object ala Refresh

  1. #1
    Join Date
    Aug 2004
    Location
    Columbus, OH
    Posts
    65

    Default Updating Session's Authentication object ala Refresh

    This must be a common problem but I didn't find a solid example in the forum. I will contrive the example to simplify the use case.

    On our client, we allow the user to opt-in to a role. We then make a call to the server to add the role to the user's record. How would I go about "refreshing" the user's credentials in the SecurityContextHolder without requiring the user to sign out and then back in?

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    You can simply set the SecurityContextHolder with the updated Authentication. You can refer to the reference for an example http://static.springsource.org/sprin...e.html#d0e2101 You might also find Getting Started With Spring Security 3.1 presentation useful (it demos how to automatically sign in a user after sign up which is similar to your scenario).
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

Posting Permissions

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