-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
CSRF Warning! State not equal in request and response. #390
Comments
same here!! Did anyone find the issue? This is my webserver_config.py on airflow . ` class CustomSecurityManager(AirflowSecurityManager): def oauth_user_info(self, provider, response): SECURITY_MANAGER_CLASS = CustomSecurityManager |
Did you manage to solve this issue? |
@carlosvega I managed to get a probably bad workaround for now: from oauthlib.oauth2.rfc6749.errors import MismatchingStateError
from flask import redirect, url_for, jsonify
import app
@app.errorhandler(MismatchingStateError)
def mismatching_state(e):
return redirect(url_for("google.login")) # You could redirect to the Google login again, which resets the session state.
# return jsonify({"error": "state_mismatch"}), 401 # Or you could handle this in any other way. You can replicate the issue via calling the "/google/authorized" (or whatever URI is set for your Authorized redirect URI) more than once. You will get the With this handler, it will redirect once and not show the |
I found this issue when trying to localtunneling for testing my local env. In local env, everything works ok.
But concerned in production for someone else spotted this too:
https://community.auth0.com/t/non-google-users-need-to-login-twice-due-to-csrf-error/77958
lepture/authlib#376
oauthlib.oauth2.rfc6749.errors.MismatchingStateError: (mismatching_state) CSRF Warning! State not equal in request and response.
I have redirect failing:
The text was updated successfully, but these errors were encountered: