Can we write a custom code to validate the oauth token which we already implemented with CustomSsoSecurityManager every request #26046
Unanswered
thanushcst
asked this question in
Q&A / Help
Replies: 1 comment 1 reply
-
Hi, did you figure this out? We have the same requirement. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We need to check each request every time on the auth token still valid if that is already invalid redirect into login page.
`class CustomSsoSecurityManager(SupersetSecurityManager):
authoauthview = CustomSsoAuthOAuthView
def oauth_user_info(self, provider, response=None):
if provider == 'wso2':
wso2_base_url = os.getenv("WSO2_BASE_URL")
me = self.appbuilder.sm.oauth_remotes[provider].get(f'{wso2_base_url}/oauth2/userinfo').json()
logging.debug(" user_data: %s", me)
prefix = 'Superset'
return {
'username' : me['username'],
'id': me['sub'],
'email': me['email'],
'roles' : me['roles']
} `
Beta Was this translation helpful? Give feedback.
All reactions