shawnzhu commented on issue #13948:
URL: https://github.com/apache/superset/issues/13948#issuecomment-856780913


   @Bonifacio-Oliveira I had the similar experience, do you mind adding debug 
info via logging?
   
   in your `CustomSsoSecurityManager`:
   
   ```
   import logging
   logger = logging.getLogger(__name__)
   
   logger.setLevel(logging.DEBUG)
   
   class CustomSsoSecurityManager(SupersetSecurityManager):
       def oauth_user_info(self, provider, response=None):
           log.debug('oauth2 provider: {0}'.format(provider))
           log.debug('response: {0}'.format(response))
           if provider == 'okta':
               user_info = 
self.appbuilder.sm.oauth_remotes[provider].get('userinfo')
               log.debug('user_info: {0}'.format(user_info))
               # maybe you want to debug the parsed id_token since you said it 
doesn't work for you
               # user_info = 
self.appbuilder.sm.oauth_remotes[provider].parse_id_token(response)
   
               me = user_info.json()
   
               return {
                   'name': me['name'],
                   'email': me['email'],
                   'id': me['email'],
                   'username': me['email'],
                   'first_name': me['given_name'],
                   'last_name': me['family_name']
               }
   ```
   
   Question: have you enabled the `userinfo_endpoint` or `server_metadata_url` 
in the oauth provider config in `superset_config.py`?


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

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