opendatahub-io-contrib / jupyterhub-odh

Example JupyterHub deployment using OpenShift OAuth authenticator.
16 stars 31 forks source link

Use OAuthClient to authenticate users to be able to gather more information #73

Open vpavlin opened 3 years ago

vpavlin commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, JH only has access to basic information about the user - i.e. username. We'd like to be able to at least access groups information, but ideally also user's OpenShift token to be able to pass it into their Jupyter environment

Describe the solution you'd like

  1. We need to create an OAuthClient resource on deployment
  2. The JH config then needs to use OAuthClient name as client_id and the same secret specified in the OAuthClient
  3. We need load the user information when we need it by calling
    auth_state = yield spawner.user.get_auth_state() #this has to be run in @gen.coroutine annotated method
  4. Implement groups and token passage into JupyterHub SIngleuser Profiles

Describe alternatives you've considered No alternative methods

Additional context

wseaton commented 3 years ago

@vpavlin I have code examples of how to accomplish 3 and 4 w/ LDAP (passing auth state to the spawner and modifying the pod spec) if you want to compare notes, this piece should work the same for any authenticator.