From d1ae385499eaf2bc91aef5ebbf67f6d4380284e9 Mon Sep 17 00:00:00 2001 From: Martin Landa Date: Sat, 18 Mar 2023 23:33:23 +0100 Subject: [PATCH] implement jupyterhub ldap intergration, #537 --- system/roles/service-jupyterhub/tasks/main.yml | 5 +++++ .../service-jupyterhub/templates/jupyterhub/gislab.py.j2 | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/system/roles/service-jupyterhub/tasks/main.yml b/system/roles/service-jupyterhub/tasks/main.yml index 944564de..fd896481 100644 --- a/system/roles/service-jupyterhub/tasks/main.yml +++ b/system/roles/service-jupyterhub/tasks/main.yml @@ -17,6 +17,11 @@ install_recommends: no state: latest +- name: Install LDAP Authenticator Plugin for JupyterHub + pip: + name: + - jupyterhub-ldapauthenticator + - name: Configure JupyterHub service template: src: "{{ item.src }}" diff --git a/system/roles/service-jupyterhub/templates/jupyterhub/gislab.py.j2 b/system/roles/service-jupyterhub/templates/jupyterhub/gislab.py.j2 index 1314312a..588ef75d 100644 --- a/system/roles/service-jupyterhub/templates/jupyterhub/gislab.py.j2 +++ b/system/roles/service-jupyterhub/templates/jupyterhub/gislab.py.j2 @@ -1 +1,5 @@ c.JupyterHub.bind_url = 'http://:{{ jupyterhub_port }}' +c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator' +c.LDAPAuthenticator.server_address = 'ldapi:///var/run/slapd/ldapi' +c.LDAPAuthenticator.use_ssl = False +c.LDAPAuthenticator.bind_dn_template = ["uid={username},ou=People,dc=gis,dc=lab"]