Announcement Announcement Module
No announcement yet.
Dynamic callback url Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic callback url

    When user is signing in from main page, then after successful authentication, he is redirected to that main page, but when he is signing in from different page (lets say from /playerconnection), then after oauth dance I'd like to redirect him to that particular page.

    My first thought was to pass some special value in state parameter and interpret it in SignInAdapter, but this parameter is not being sent.

    Later on I wanted to dynamically generate callbackUrl, but I'm not sure, whether this will not force me to define several callbacks for each provider.

    Any ideas how I should accomplish that ?

  • #2
    May I assume that you're using Spring Security as the security mechanism here? If so, then you can get it from the SavedRequest object which you can get via a RequestCache. Have a look at the SimpleSignInAdapter in Spring Social Showcase for an example:


    • #3
      Yes, I'm using Spring Security, but...

      RequestCache is being used by ExceptionTranslationFilter, that catches AccessDeniedException. This happens when user is not authenticated and tries to access protected resource and it works great.
      In my case flow is a bit different (sorry for not being precise), namely user is already authenticated (so there will be no exception) and I want to create another connection between he's account in my service and he's account in some social portal.