hsnotebook commented on issue #2580:
URL: https://github.com/apache/superset/issues/2580#issuecomment-900142885


   Try this in superset_config.py:
   `from flask_appbuilder.security.views import expose
   from superset.security import SupersetSecurityManager
   from flask_appbuilder.security.manager import BaseSecurityManager
   from flask_appbuilder.security.manager import AUTH_REMOTE_USER
   from flask import  redirect
   from flask_login import login_user
   
   # Create a custom view to authenticate the user
   AuthRemoteUserView=BaseSecurityManager.authremoteuserview
   class AirbnbAuthRemoteUserView(AuthRemoteUserView):
       @expose('/login/')
       def login(self):
         user = self.appbuilder.sm.auth_user_db("admin", "admin")
         login_user(user, remember=False)
         return redirect(self.appbuilder.get_url_for_index)
   
   
   # Create a custom Security manager that override the authremoteuserview with 
the one I've created
   class CustomSecurityManager(SupersetSecurityManager):
       authremoteuserview = AirbnbAuthRemoteUserView
   
   # Use my custom authenticator
   CUSTOM_SECURITY_MANAGER = CustomSecurityManager
   
   # User remote authentication
   AUTH_TYPE = AUTH_REMOTE_USER
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to