You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 02:54:31 UTC
Re: [D] Need to bypass the SSO login page when coming from another platform, but if using standalone sjperset need to Loginvia the Oauth provider itself [superset]
GitHub user dosubot[bot] edited a comment on the discussion: Need to bypass the SSO login page when coming from another platform, but if using standalone sjperset need to Loginvia the Oauth provider itself
<!-- Answer -->
When you enable OAUTH2 in Superset, the `/login` page displays a "Sign in with {provider}" button for each configured OAuth provider, not a traditional username/password form. This UI is rendered in React and adapts based on your `AUTH_TYPE` config—so with OAUTH2, you'll see only the OAuth sign-in button(s) unless you customize further [(source)](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/pages/Login/index.tsx).
Superset does not natively support bypassing the login page based on the request origin or referrer. Extending `IndexView` is not the right approach for this—`IndexView` only handles the root (`/`) route and redirects to the welcome page; it doesn't control authentication or the login process [(source)](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/initialization/__init__.py).
To implement conditional login bypass (e.g., auto-login if coming from another platform, but require OAuth login for standalone users), the recommended pattern is to create a custom authentication view (by subclassing `AuthDBView` or `SupersetAuthView`) and/or a custom security manager. In your custom view, you can check for a token, header, or other indicator in the request—if present, programmatically log in the user and redirect; otherwise, show the standard login UI [(example)](https://github.com/apache/superset/discussions/32472):
```python
from flask_appbuilder.security.views import AuthDBView, expose
from flask_login import login_user
from flask import redirect, request
class CustomAuthDBView(AuthDBView):
@expose('/login/', methods=['GET', 'POST'])
def login(self):
token = request.args.get('token')
if token == 'SOME_TOKEN_VALUE':
user = self.appbuilder.sm.find_user(username=request.args.get('username'))
if user:
login_user(user)
return redirect(self.appbuilder.get_url_for_index)
return super(CustomAuthDBView, self).login()
from superset.security import SupersetSecurityManager
class CustomSecurityManager(SupersetSecurityManager):
authdbview = CustomAuthDBView
# In your superset_config.py:
CUSTOM_SECURITY_MANAGER = CustomSecurityManager
```
This lets you support both flows: users redirected from another platform with a valid token can bypass the login page, while standalone users still see the OAuth login button and authenticate normally [(reference)](https://github.com/apache/superset/discussions/32424).
Remember to handle security carefully—validate any tokens or headers you use for bypass, and ensure session management is robust. All customization should be done via the `CUSTOM_SECURITY_MANAGER` config, not by modifying `IndexView`.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=d41ed69b-f2e9-44be-b8d2-8d9c5a9fd792) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/34532#discussioncomment-13989081
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org