Skip to content

Commit 6dfe3b2

Browse files
authored
Merge pull request #4977 from minrk/health-chcs-auth
jupyter-health: use CHCS auth provider for staging
2 parents 71036c4 + ef984e1 commit 6dfe3b2

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

config/clusters/jupyter-health/staging.values.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,32 @@ jupyterhub:
99
secretName: https-auto-tls
1010
hub:
1111
config:
12-
GitHubOAuthenticator:
12+
JupyterHub:
13+
# Uses CHCS auth provider
14+
# Note: 2i2c engineers can not log in via this, so they can not provide support that
15+
# requires logging into this hub. But since Jupyter Health team members have access to this
16+
# repo, this is acceptable
17+
authenticator_class: generic-oauth
18+
GenericOAuthenticator:
19+
client_id: Ima7rx8D6eko0PzlU1jK28WBUT2ZweZj7mqVG2wm
1320
oauth_callback_url: https://staging.jupyter-health.2i2c.cloud/hub/oauth_callback
21+
authorize_url: https://chcs.fly.dev/o/authorize/
22+
token_url: https://chcs.fly.dev/o/token/
23+
userdata_url: https://chcs.fly.dev/api/v1/users/profile
24+
username_claim: email
25+
login_service: CHCS
26+
scope:
27+
- openid
28+
enable_auth_state: true
29+
extraConfig:
30+
# add access tokens via auth state
31+
auth_state_env.py: |
32+
def auth_state_env(spawner, auth_state):
33+
if not auth_state:
34+
spawner.log.warning(f"Missing auth state for user {spawner.user.name}")
35+
return
36+
spawner.environment["CHCS_TOKEN"] = auth_state["access_token"]
37+
spawner.environment["CHCS_REFRESH_TOKEN"] = auth_state["refresh_token"]
38+
spawner.environment["CHCS_CLIENT_ID"] = "Ima7rx8D6eko0PzlU1jK28WBUT2ZweZj7mqVG2wm"
39+
40+
c.Spawner.auth_state_hook = auth_state_env

0 commit comments

Comments
 (0)