GitHub user quanngo added a comment to the discussion: Invalid login. Please 
try again. When i try to configure SSO using Zitadel and superset

```
  import logging
  from superset.security import SupersetSecurityManager
  
  class CustomSsoSecurityManager(SupersetSecurityManager):

      def oauth_user_info(self, provider, response=None):
          logging.debug("Oauth2 provider: {0}.".format(provider))
          if provider == 'drhSSO':
              # As example, this line request a GET to base_url + '/' + 
userDetails with Bearer  Authentication,
      # and expects that authorization server checks the token, and response 
with user details
              me = 
self.appbuilder.sm.oauth_remotes[provider].get('userDetails').data
              logging.debug("user_data: {0}".format(me))
              return { 'name' : me['name'], 'email' : me['email'], 'id' : 
me['user_name'], 'username' : me['user_name'], 'first_name':'', 'last_name':''}
    ...
```
    
In this you need to use (in my case i'm using email for checking)

```
user = self.find_user(email=data['mail'])

login_user(user, remember=False)

user_info = {
                'name' : user['name'],
                'email' : user['email'],
                'id' : user['id'],
                'username' : user['username'],
                'first_name': user['first_name'],
                'last_name': user['last_name'],
                # 'role': user['role']
            }

return user_info       
```

data is from Azure Entra Get me 

but unfortunately I'm still having issue **Invalid login, Please try again**, 
but it's still work like login successful. Any advice?


GitHub link: 
https://github.com/apache/superset/discussions/32908#discussioncomment-12665516

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