Portal OAUTH Authentication

Adding support for specific oauth server

  • You need to add an application in oauth server in order to obtain a client ID and client SECRET
    • In case of github, open settings/applications/developer applications then create a new app there
  • Add support in portal for that application

Force using oauth only authentication

  • During installing portal set the "force_oauth_instance" attribute value to the name of the oauth instance you want to force using.

Development Section

  • Support for oauth authentication is spread across 3 areas
    • @ys package : _clients/oauth_client
    • jumpscale client : jumpscale_core7/lib/Jumpscale/baselib/oauth/OauthInstance.py
      * You can use it from shell using `j.clients.oauth.get(type='github')` 
      * replace type by whatever instance you need.
      
    • jumpscale portal support
      • actors: jumpscale_portal/apps/system/system__oauth
        • authenticate :/restmachine//system/oauth/authenticate?type=github redirects to certain oauth server
        • authorize : /restmachine//system/oauth/authorize call back api oauth server calls
  • If username and email returned from oauth server found in osis then user is logged in.
  • If username is found but email is different than that returned from oauth server, 400 bad request (User already exists) response is returned

Force using oauth only authentication

  • During installing portal set the "force_oauth_instance" attribute value to the name of the oauth instance you want to force using.

results matching ""

    No results matching ""