-
-
Notifications
You must be signed in to change notification settings - Fork 548
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
Getting AuthStateMissing/social-auth/complete/{backend}/ error #250
Comments
I believe I suffer from the same problem:
I'm using Google OAuth2 backend and my pipeline is: SOCIAL_AUTH_PIPELINE = (
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.auth_allowed',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.social_auth.associate_by_email',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
) |
I am experiencing the same issue. It happens when Googlebot tries to access /complete/google-oauth2/ url directly. Edit: One possible solution is to detect the missing query string in, for example, Apache config. Something like: would make sure that the page is not being accessed without the state specified. |
Another thing to try if you are seeing the In my case, I only saw the error on Safari upon the redirect in the last leg of Oauth. The weirdest part was that I could refresh the page and the error would go away. Upon further digging, I realized Safari wasn't sending any cookies on the redirect, but would send cookies when I hit refresh (so the cookies were set correctly, just not being sent). I found the SESSION_COOKIE_SAMESITE setting which, by default, will strip your cookies on that redirect, and thus Django cannot find your session. |
HI everyone, I am new to this and I am facing the same issue. any help will be appreciated. Thanks. |
I was also facing the same issue. But changing SESSION_COOKIE_SAMESITE from 'strict' to None solved the same for me. Hence, check this in your settings,py if this can solve your problem |
I was able to solve the issue by running an "Empty Cache and Hard Reload" in Google Chrome (https://www.thewindowsclub.com/empty-cache-hard-reload-chrome) |
This fixed the issue for me as well, thank you! |
As far as I understand, for many, the problem will also be that the state parameter cannot be passed via http. To do this, it will wait for the transition to https, otherwise it will not include the state parameter. When I connect SSL, I will be able to tell about it for sure. |
After setting |
I am doing authentication from flutter, not from browser. For now I'm testing with swagger. I added the |
I'm connecting from swagger (later the connection will be from flutter) and even after setting |
Does anyone resolved this Issue? Its happening with apple sign in. |
For Apple Sign-in, setting |
This also happens for me on occasional logins. Happens with Spotify auth and (mostly) Safari clients. |
FWIW, we were seeing this happen occassionally. In our case, the problem was that we had a pod running with an invalid Django |
@taobojlen Could there be a problem, that |
@PetrDlouhy I wouldn't say so. From the perspective of python-social-auth, it is indeed true that the auth state is missing! The deeper problem, you might argue, is that Django does not raise an exception if it cannot validate a session -- instead, it just returns a string like "Session invalid" or something. |
I have read the discussions on this bug report omab/python-social-auth#534, but unfortunately, I could not figure how to resolve my issue. I have just started working on the project that uses social django, and I apologise if I have asked a stupid question.
I am getting the following error in our production logs
In our production, we have written our custom OAuth2 implementation a custom backend which does a 302 redirect to the redirect uri, which is deployed on a different host than our OAuth2 backend.
Our pipelines
These are all the logs that I have. I don't know what I could be doing wrong for this to be raised. Any suggestions would be gratefully appreciated.
The text was updated successfully, but these errors were encountered: