Skip to content

Commit

Permalink
Merge pull request #523 from manics/auth-scopes
Browse files Browse the repository at this point in the history
Allow configuration of OAuthenticator.scope
  • Loading branch information
minrk authored Feb 26, 2018
2 parents 14f1b09 + 9b428f1 commit 9cfcc6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion images/hub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
org_whitelist = get_config('auth.github.org_whitelist', [])
if len(org_whitelist) != 0:
c.GitHubOAuthenticator.github_organization_whitelist = org_whitelist
c.GitHubOAuthenticator.scope = ['read:org'] # required for private membership
elif auth_type == 'cilogon':
c.JupyterHub.authenticator_class = 'oauthenticator.CILogonOAuthenticator'
c.CILogonOAuthenticator.oauth_callback_url = get_config('auth.cilogon.callback-url')
Expand Down Expand Up @@ -186,6 +185,10 @@
else:
raise ValueError("Unhandled auth type: %r" % auth_type)

auth_scopes = get_config('auth.scopes')
if auth_scopes:
c.OAuthenticator.scope = auth_scopes

c.Authenticator.enable_auth_state = get_config('auth.state.enabled', False)

def generate_user_email(spawner):
Expand Down
5 changes: 5 additions & 0 deletions jupyterhub/templates/hub/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ data:
auth.custom.config : {{ toJson .Values.auth.custom.config | quote }}
{{- end }}

{{ if .Values.auth.scopes -}}
auth.scopes: |
{{ toYaml .Values.auth.scopes | indent 4}}
{{- end }}

auth.state.enabled: {{ .Values.auth.state.enabled | quote }}

{{ if .Values.singleuser.lifecycleHooks -}}
Expand Down

0 comments on commit 9cfcc6e

Please sign in to comment.