GitHub user alex1404 edited a comment on the discussion: AUTH_REMOTE_USER is 
not working after upgrade Apache superset 6.0.0rc4/3

@dosu, This is custom code that previously worked in Apache Superset v5.  Part 
of configOverrides in values.yaml. Were there any changes introduced in Apache 
Superset v6 that could potentially affect this implementation?               
```
user_manager.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,  request
      from flask_login import login_user
      from flask_appbuilder._compat import as_unicode
      import logging
      import jwt
      log = logging.getLogger(__name__)
      
      # Create a custom view to authenticate the user
      AuthRemoteUserView=BaseSecurityManager.authremoteuserview
      class MuseAuthRemoteUserView(AuthRemoteUserView):
          @expose('/login/')
          def login(self):      
            user = self.appbuilder.sm.auth_user_db("xxxx", "xxxx")
            login_user(user, remember=False)
            return redirect('/dashboard/list/')
      
      
      
      # Create a custom Security manager that override the authremoteuserview 
with the one I've created
      class CustomSecurityManager(SupersetSecurityManager):
            authremoteuserview = MuseAuthRemoteUserView
      
      # Use my custom authenticator
      CUSTOM_SECURITY_MANAGER = CustomSecurityManager
      # User remote authentication
      AUTH_TYPE = AUTH_REMOTE_USER
```

GitHub link: 
https://github.com/apache/superset/discussions/36446#discussioncomment-15186689

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to