New HttpSession Created on LinkedIn Oauth Return Channel

I use GWT on my client side and call the Http Servlet (registration servlet), designed to log in to oauth.

As soon as the user clicks the login button on the page, I call the registration servlet email method to get the authorization URL and save some parameters in the session.

I defined the path of one registration servlet as the callback URL for Authentication LinkedIn. Therefore, as soon as the user completes the registration for linkedin, the links on the linkedIn page get the method of a single registration servlet. But sometimes I get a different session in the get method, and sometimes in the same session. I need an initial session in order to be able to save saved settings.

Someone suggested in this post that we can pass the JSessionID in the url callback as a parameter. But there is still a problem with retrieving the Session object from this JSessionID.

Help would be greatly appreciated.

+4
source share
1 answer

Well, instead of an answer, this is more than a different approach.

In my last project, we had the same scenario: OAuth, Servlets, something to do, sessions with some parameters ...

We used Spring Security for this management, and it worked fine. The configuration is not too complicated ...

Have you tried with it?

+2
source

Source: https://habr.com/ru/post/1487324/


All Articles