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 03:23:07 UTC
Re: [D] How to customize the logout behavior? I need to redirect to a specified URL when logging out. [superset]
GitHub user dosubot[bot] edited a comment on the discussion: How to customize the logout behavior? I need to redirect to a specified URL when logging out.
<!-- Answer -->
Superset's logout behavior is managed by Flask AppBuilder (FAB), not by a custom method in Superset itself. To redirect users to a specific URL after logout, you typically need to customize the Flask AppBuilder security manager. There isn't a built-in LOGOUT_REDIRECT_URL setting in Superset, but you can achieve this by subclassing the security manager and overriding the logout view to use Flask's redirect function.
Here's a general approach:
1. In your superset_config.py, define a custom security manager that overrides the logout method to redirect to your desired URL.
2. Set your custom security manager in the SUPSET_CONFIG.
Example:
```python
from flask import redirect
from superset.security import SupersetSecurityManager
from flask_appbuilder.security.views import AuthDBView
from flask_appbuilder.security.views import expose
class CustomAuthDBView(AuthDBView):
@expose('/logout/')
def logout(self):
response = super().logout()
return redirect("https://your-redirect-url.com")
class CustomSecurityManager(SupersetSecurityManager):
authdbview = CustomAuthDBView
CUSTOM_SECURITY_MANAGER = CustomSecurityManager
```
Add this to your superset_config.py. This will override the default logout behavior and redirect users to your specified URL after logout. For more details on customizing authentication and redirection, see the discussion [here](https://github.com/apache/superset/discussions/32038).
Let me know if you need a more specific example for your authentication backend.
<!-- 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=38892483-96b6-4961-b567-20e46d63e810) [](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/33812#discussioncomment-13503641
----
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