Negashev commented on issue #8932:
URL: https://github.com/apache/superset/issues/8932#issuecomment-1805976148

   For gitlab oauth in helm
   ```
       configOverrides:
         ingress_proxy: |
           ENABLE_PROXY_FIX = True
           TALISMAN_ENABLED = False
         enable_oauth: |
           from flask_appbuilder.security.manager import (AUTH_DB, AUTH_OAUTH)
           AUTH_TYPE = AUTH_OAUTH
           OAUTH_PROVIDERS = [
               {
                   "name": "gitlab",
                   "icon": "fa-gitlab",
                   "token_key": "access_token",
                   "remote_app": {
                       "jwks_uri": "https://gitlab.SERVER/-/jwks";,
                       "client_id": "CHANGE_ME_1",
                       "client_secret": "CHANGE_ME_2",
                       "api_base_url": "https://gitlab.SERVER/api/v4/user";,
                       "client_kwargs": {"scope": "email openid read_user 
profile"},
                       "request_token_url": None,
                       "access_token_url": "https://gitlab.SERVER/oauth/token";,
                       "authorize_url": "https://gitlab.SERVER/oauth/authorize";
                   }
               }
           ]
   
           AUTH_USER_REGISTRATION = True
           AUTH_USER_REGISTRATION_ROLE = 'Admin'
           AUTH_ROLE_ADMIN = 'Admin'
         auth_manager: |
           import logging
           from superset.security import SupersetSecurityManager
   
           class GitlabSecurityManager(SupersetSecurityManager):
               def oauth_user_info(self, provider, response=None):
                   logging.debug("Oauth2 provider: {0}.".format(provider))
                   if provider == 'gitlab':
                           me = 
self.appbuilder.sm.oauth_remotes[provider].get('user').json()
                           logging.debug("user_data: {0}".format(me))
                           name = me['name']
                           first_name = ''
                           last_name = ''
                           if ' ' in name:
                                   s = name.split(' ')
                                   first_name = s[0]
                                   last_name = s[1]
                           return { 'name' : me['name'], 'email' : me['email'], 
'id' : me['id'], 'username' : me['username'], 'first_name': first_name, 
'last_name': last_name}
           CUSTOM_SECURITY_MANAGER = GitlabSecurityManager
   ```


-- 
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