quanngo commented on issue #28103:
URL: https://github.com/apache/superset/issues/28103#issuecomment-2418499709
`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'])`
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
--
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]