Access to external oauth token

Hi, is there a way to get the (external, keycloak) access token got by the oauthenticator from within a custom widget?

Authenticator.pre_spawn_start hook can be used to pass fields from auth_state, which can include the token to the Spawner environment. We have an example that does this for GitHub, but it works for anything if you specify the fields to map from auth_state to environment.

1 Like