Skip to content

Commit afb8a91

Browse files
Luca De FeoLuca De Feo
authored andcommitted
Moved from OAuth + bridge to CASAuthenticator
1 parent d2e20a3 commit afb8a91

File tree

4 files changed

+13
-73
lines changed

4 files changed

+13
-73
lines changed

docker-compose.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,5 @@ services:
3737
- /var/run/docker.sock:/var/run/docker.sock
3838
restart: on-failure
3939

40-
oauth2_server:
41-
image: defeo/cas2oauth2bridge
42-
container_name: c2o2b
43-
volumes:
44-
- ./oauth2/config.js:/home/node/config.js
45-
labels:
46-
- "traefik.enable=true"
47-
- "traefik.frontend.rule=Host:jupyter.ens.uvsq.fr;PathPrefixStrip:/c2o2b/"
48-
restart: on-failure
49-
5040
volumes:
5141
jupyterhub_data:

jupyterhub/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ RUN wget https://raw.githubusercontent.com/jupyterhub/jupyterhub/0.9.3/examples/
66

77
RUN pip install \
88
dockerspawner==0.10.0 \
9-
oauthenticator==0.8.0
9+
jhub_cas_authenticator==1.0.0

jupyterhub/jupyterhub_config.py

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,18 @@
33
c.Spawner.default_url = '/lab'
44

55
## Authenticator
6-
from oauthenticator.oauth2 import OAuthLoginHandler
7-
from oauthenticator.generic import GenericOAuthenticator
8-
from tornado.auth import OAuth2Mixin
9-
10-
class UVSQMixin(OAuth2Mixin):
11-
_OAUTH_AUTHORIZE_URL = 'https://jupyter.ens.uvsq.fr/c2o2b/login'
12-
_OAUTH_ACCESS_TOKEN_URL = 'https://jupyter.ens.uvsq.fr/c2o2b/token'
13-
14-
class UVSQLoginHandler(OAuthLoginHandler, UVSQMixin):
15-
pass
16-
17-
class UVSQAuthenticator(GenericOAuthenticator):
18-
login_service = 'UVSQ'
19-
login_handler = UVSQLoginHandler
20-
client_id = '0'
21-
client_secret = ''
22-
userdata_url = 'https://jupyter.ens.uvsq.fr/c2o2b/userdata'
23-
token_url = 'https://jupyter.ens.uvsq.fr/c2o2b/token'
24-
oauth_callback_url = 'https://jupyter.ens.uvsq.fr/hub/oauth_callback'
25-
26-
c.JupyterHub.authenticator_class = UVSQAuthenticator
6+
from jhub_cas_authenticator.cas_auth import CASAuthenticator
7+
c.JupyterHub.authenticator_class = CASAuthenticator
8+
9+
# The CAS URLs to redirect (un)authenticated users to.
10+
c.CASAuthenticator.cas_login_url = 'https://cas.uvsq.fr/login'
11+
c.CASLocalAuthenticator.cas_logout_url = 'https://cas.uvsq/logout'
12+
13+
# The CAS endpoint for validating service tickets.
14+
c.CASAuthenticator.cas_service_validate_url = 'https://cas.uvsq.fr/serviceValidate'
15+
16+
# The service URL the CAS server will redirect the browser back to on successful authentication.
17+
c.CASAuthenticator.cas_service_url = 'https://sage.prism.uvsq.fr/hub/login'
2718

2819
c.Authenticator.admin_users = { 'lucadefe' }
2920

oauth2/config.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)