You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "architmmmec (via GitHub)" <gi...@apache.org> on 2023/04/21 05:01:14 UTC

[GitHub] [superset] architmmmec opened a new issue, #23764: AuthN. integration not working

architmmmec opened a new issue, #23764:
URL: https://github.com/apache/superset/issues/23764

   A clear and concise description of what the bug is.
   AuthN integration is not working
   
   #### How to reproduce the bug
   
   class CustomSsoSecurityManager(SupersetSecurityManager):
   
       def oauth_user_info(self, provider, response=None):
           logging.debug("Oauth2 provider: {0}.".format(provider))
           if provider == 'authn':
               headers = {
                   'Authorization': 'Bearer ' + response.get('access_token')
               }
               me = self.appbuilder.sm.oauth_remotes[provider].get('userDetails').data
               logging.debug("user_data: {0}".format(me))
               logging.debug("Headers" + headers)
               authn_user_info_response = self.appbuilder.sm \
                   .oauth_remotes[provider] \
                   .get('/oauth/r/api/v1/user/details', headers=headers)
               logging.debug("AuthN user info" + authn_user_info_response)
               user_info = authn_user_info_response.data
               return {
                   'name': user_info['sub'],
                   'email': user_info['email'],
                   'id': user_info['sub'],
                   'username': user_info['sub'],
                   'first_name': user_info['sub'].split(".")[0],
                   'last_name': user_info['sub'].split(".")[-1]
               }
   
   AUTHN_URL = os.environ["AUTHN_URL"]
   OAUTH_PROVIDERS = [
       {
           'name': 'authn',
           'whitelist': '*****',
           'token_key': 'access_token',
           'icon': 'fa-address-card',
           'remote_app': {
               # 'consumer_key': CONFIG_DATA['CLIENT_ID'],
               # 'consumer_secret': CONFIG_DATA['CLIENT_SECRET'],
   
               'client_id':'*******',
               'client_secret': '*****',
   
               'request_token_params': {
                   'scope': 'user.profile'
               },
               'access_token_params':{        # Additional parameters for calls to access_token_url
                   'client_id': '******'
               },
               'request_token_url': None,
               'access_token_method': 'POST',
               'api_base_url': AUTHN_URL,
               'access_token_url': AUTHN_URL + '/oauth/token',
               'authorize_url': AUTHN_URL + '/oauth/authorize'
           }
       }
   ]
   
   ### Expected results
   Should be able to lntegrate with AuthN and login 
   
   what you expected to happen.
   
   ### Actual results
   Login denied
   
   what actually happens.
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version:
   - superset version: 2.1.0
   - python version: 3.9
   - node.js version: `node -v`
   - any feature flags active: Yes
   
   
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] AuthN. integration not working [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23764:
URL: https://github.com/apache/superset/issues/23764#issuecomment-1965490229

   Closing this as stale since it's been silent for so long, and we're trying to steer toward a more actionable Issues backlog. If people are still encountering this in current versions (currently 3.x) please re-open this issue, open a new Issue with updated context, or raise a PR to address the problem. Thanks!
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on issue #23764: AuthN. integration not working

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23764:
URL: https://github.com/apache/superset/issues/23764#issuecomment-1522142314

   I don't think you'll find that many folks are able to help troubleshoot custom security managers since they'll all have unique code and quirks. You might be able to recruit some help on [Slack](http://bit.ly/join-superset-slack) in `#debug-together` or `#customizing-superset`. 
   
   I don't think this is technically a bug, so we might close it soon, but we'll leave it open for now in hopes that someone can help 🤞 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] AuthN. integration not working [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #23764: AuthN. integration not working
URL: https://github.com/apache/superset/issues/23764


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org