I can’t fully infer your issue here, but you aren’t setting OAUTH2_USERDATA_URL in the env vars as a start.
From generic.py (generic OAuthenticator)
url = url_concat(self.userdata_url, self.userdata_params)
raise ValueError("Please set the OAUTH2_USERDATA_URL environment variable")
Actually, I think I just ended up setting everything in hub.extraEnv because that’s where the generic authenticator actually gets its values instead of from the config. This was my working structure:
# Jupyterhub callback (default: https://<host>/hub/oauth_callback)
# User information is used to name server created by kubespawner.
# General settings
OAUTH2_TLS_VERIFY : 'true'
Two things to make sure of:
- If you are using your own custom oauth, are you making sure that you implemented a listener/endpoint/handler at oauth_userdata_url?
I won’t paste too much code here but in generic.py (the generic OAuthenticator):
if not resp_json.get(self.username_key):
self.log.error("OAuth user contains no key %s: %s", self.username_key, resp_json)
You need to be certain that whatever provider you are using for your auth is returning a json dict that includes a key value pair where at least one key == ‘username_key’.
- GenericOAuthenticator does’t include client_secret and client_id in the POST body when it sends the first POST to actually get a token. https://github.com/jupyterhub/oauthenticator/pull/274
The workaround is to add client_id and client_secret to your auth.className.config.extra_params
login_service: 'Your Auth'
client_id : 'TEST12345'
This is also what my config looks like, I added almost everything in the env vars and auth does work. If you gave me a little more detail perhaps I could help further.