Superset 6: Bypass Login page of superset No Longer Working (Worked in v5) #37057
Replies: 2 comments 6 replies
-
|
This change is due to breaking changes in Superset 6 and the Flask-AppBuilder 5.0.0 upgrade, which altered how authentication views are registered and handled. Superset 6 now uses its own The recommended approach is to create a custom authentication view (subclassing Here’s a simplified example pattern: from flask_appbuilder.security.views import AuthOAuthView, expose
from flask_login import login_user
from flask import redirect, request, g
from superset.security import SupersetSecurityManager
class CustomSsoAuthOAuthView(AuthOAuthView):
@expose("/login/")
@expose("/login/<provider>")
def login(self, provider: str = None):
if g.user is not None and g.user.is_authenticated:
return redirect(self.appbuilder.get_url_for_index)
# Insert your logic here to check for OAuth session/cookie/token
# If already authenticated with OAuth provider, log in and redirect
# Otherwise, proceed with normal OAuth login
return super().login(provider)
class CustomSecurityManager(SupersetSecurityManager):
authoauthview = CustomSsoAuthOAuthView
# In superset_config.py
CUSTOM_SECURITY_MANAGER = CustomSecurityManagerYou can adapt the logic inside Be sure to validate any tokens/headers you use for bypass and ensure robust session management for security4. References and more patterns:
To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other Footnotes |
Beta Was this translation helpful? Give feedback.
-
#37394 try FLASK_APP_MUTATOR, but I didn't test it for production. Could you share your feedback in this discussion after? |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi Superset team,
After upgrading from Superset 5 to Superset 6, we’ve encountered an issues that used to work previously (in version 5):
In Superset 5, we used a custom AuthOAuthView to bypass the login page if the user was already authenticated with our OAuth provider. Our code looked like this (Was inspired from dpgaspar/Flask-AppBuilder#2225 (comment)):
This allowed users to be logged in automatically (Without seeing the LOGIN page of the superset) if they were already authenticated with the OAuth provider (ie ; bypassing the login page of superset) , if thy were not authenticated with the Oauth provider then they would have seen or encoutered the OAuth providers sign in page - THIS APPROACH WAS 100% working in superset version 5]
After upgrading to Superset 6, this no longer works—users are always redirected to the login page, even if they are already authenticated.
Is this related to the upgrade to Flask-AppBuilder 5.0.0 or any other breaking change in Superset 6?
Is there a new recommended way to implement this bypass login behavior in version 6- so that only the OAUTH login page has to be seen by the user (if he or she is not signed in OAUTH provider).
Refer image for the page that i used to avoid
Beta Was this translation helpful? Give feedback.
All reactions