Single Sign On - Error authorizing OAuth access token: mismatching_state: CSRF Warning! State not equal in request and response. #31440
Replies: 3 comments 1 reply
-
Hey there, @Piyush-Fury! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve the issue. I found a similar discussion regarding a "Recursive login loop" issue, which might be related to your problem. This issue was addressed by a fix included in Superset version 3.1.0. However, users of versions 3.0.0 to 3.0.2 might still encounter this problem. The discussion suggests adding Additionally, ensure that your To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
I found a similar issue regarding the "mismatching_state: CSRF Warning! State not equal in request and response" error when setting up OAuth login with Authentik in Apache Superset. This issue was addressed in Superset version 3.1.0. For versions 3.0.0 to 3.0.2, it is suggested to add To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
@dosu the configurations you suggested me to add or change i have already done that and the issue is same. |
Beta Was this translation helpful? Give feedback.
-
Bug description
Hello everyone, We are trying to add the OAUTH login using the Authentik identity server. We have setup the configuration as per the documentation. You can find the OAUTH configuration below.
postgresql:
postgresqlPassword: superset
configOverrides:
secret: |
import os
SECRET_KEY = '<>'
enable_oauth: |
# Enable proxy fix for correct redirect_uri computation
ENABLE_PROXY_FIX = True
FEATURE_FLAGS = {"DYNAMIC_PLUGINS": True}
bootstrapScript: |
#!/bin/bash
pip install psycopg2==2.9.6
sqlalchemy-bigquery==1.6.1
elasticsearch-dbapi==0.2.5 &&
pip install --no-cache-dir packaging==21.0 &&
if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
extraEnv:
AUTH_DOMAIN: authentik.piyush.today
SESSION_COOKIE_SECURE: "True"
SESSION_COOKIE_HTTPONLY: "True"
SESSION_TIMEOUT: "3600"
SECRET_KEY: "<>"
AUTHENTIK_OAUTH_REDIRECT_URI: "http://superset.piyush.today/oauth-authorized/authentik"
Highlighted New Configuration
SESSION_COOKIE_DOMAIN: "superset.piyush.today" # Added domain to cookies
POSTGRES_USER: "superset"
POSTGRES_PASSWORD: "superset"
POSTGRES_DB: "superset"
POSTGRES_HOST: "superset-postgresql"
POSTGRES_PORT: "5432"
extraSecretEnv:
secretName: superset-secret
key: SECRET_KEY
secretName: authentik-client-id-secret
key: AUTHENTIK_CLIENT_ID
secretName: authentik-client-secret-secret
key: AUTHENTIK_CLIENT_SECRET
ingress:
enabled: true
annotations:
alb.ingress.kubernetes.io/scheme: "internet-facing"
alb.ingress.kubernetes.io/target-type: "ip"
alb.ingress.kubernetes.io/load-balancer-name: "aws-alb-superset"
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
alb.ingress.kubernetes.io/healthcheck-path: /health
alb.ingress.kubernetes.io/success-codes: "200"
alb.ingress.kubernetes.io/manage-backend-security-group-rules: "true"
alb.ingress.kubernetes.io/security-groups: "sg-0e7244a820c5e03ce"
alb.ingress.kubernetes.io/subnets: "subnet-0e93acffe7efb7530,subnet-064a10482338a08a4,subnet-010368913ca69b726"
path: /
pathType: Prefix
hosts:
- superset.piyush.today
ingressClassName: alb
After successful login, the user is again redirected to the login page, I checked the container logs, We are getting this following error
ERROR:flask_appbuilder.security.views:Error authorizing OAuth access token: mismatching_state: CSRF Warning! State not equal in request and response
I am searching for solutions, most of the github issues from other projects, didn't seem to help. Any help would be much appreciated. Thank you.
helm vhart : 0.10.9
Superset Version: 3.0.0
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
I don't know
Node version
I don't know
Browser
Chrome
Additional context
No response
Checklist
Beta Was this translation helpful? Give feedback.
All reactions