GitHub user moshhi added a comment to the discussion: How to customize the 
logout behavior? I need to redirect to a specified URL when logging out.

I added code: `import logging
from flask import redirect
from superset.security import SupersetSecurityManager
from flask_appbuilder.security.views import AuthDBView
from flask_appbuilder.security.views import expose

log = logging.getLogger(__name__)

class CustomAuthDBView(AuthDBView):
    @expose('/logout/')
    def logout(self):
        response = super().logout()
        return redirect("https://example/";)


class CustomSsoSecurityManager(SupersetSecurityManager):
    authdbview = CustomAuthDBView

    def oauth_user_info(self, provider, response=None):
        log.info("Oauth2 provider: {0}.".format(provider))
        pass

    def auth_user_oauth(self, userinfo):
        """
        Method for authenticating user with OAuth.

        :userinfo: dict with user information
                   (keys are the same as User model columns)
        """
        # extract the username from `userinfo`
        pass


CUSTOM_SECURITY_MANAGER = CustomSsoSecurityManager
`
and added this to my superset_config.py, however it doesn't work, when I 
logout, it didn't redirect to "https://example/";

GitHub link: 
https://github.com/apache/superset/discussions/33812#discussioncomment-13505395

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to