Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional SessionStateMissing exception on Linkedin #780

Closed
merutak opened this issue Nov 7, 2015 · 2 comments
Closed

Occasional SessionStateMissing exception on Linkedin #780

merutak opened this issue Nov 7, 2015 · 2 comments

Comments

@merutak
Copy link

merutak commented Nov 7, 2015

I'm getting this whenever the user hits /complete/linkedin-oauth2/ twice. I'm guessing - not sure - that what happens is this:

  • The user clicks the 'accept' button twice by mistake (or maybe because of a bug with the provider's front end).
  • The first 'complete' pops the session state and tries to continue with the pipeline. It fails because the provider revoked the token, because of the second request.
  • The second 'complete' doesn't find the state so fails.

If this is indeed the issue, maybe we can somehow avoid popping the session state; rather leaving it as is for the next request.

(I posted this as a comment on #220 but the original issue there was different, so I figured it's better as a separate issue).

@ddehghan
Copy link

I also have the same missing session state problem but mine is with google auth. I tried to reproduce this with google oauth and it didn't. So at least with google auth it seems that you can't double click:

here is in order how values get set and poped in session for me:

pop partial_pipeline
value: None
pop partial_pipeline
value: None
get google-oauth2_state
value: None
set google-oauth2_state
value: nlAPKf8OVsZ9Uqw7ePbuwbCD45faPM

127.0.0.1 - - [20/Nov/2015 13:03:59] "GET /login/google-oauth2/? HTTP/1.1" 302 -
get partial_pipeline
value: None
get google-oauth2_state
value: nlAPKf8OVsZ9Uqw7ePbuwbCD45faPM
pop partial_pipeline
value: None
get next

set social_auth_last_login_backend
value: google-oauth2

@omab
Copy link
Owner

omab commented Dec 27, 2016

Fixed by python-social-auth/social-core@4d2903c.

@omab omab closed this as completed Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants