I have 2 side-by-side ubuntu servers (EC2).
On one, I followed the vanilla install instructions, including SSL and Cognito integration, and it works as expected.
On the other, I did the same thing, except that the machine was already setup with python and a conda environment.
In the latter, when I try to use Cognito for authentication (specified below), I get this error:
python3[86637]: [C 2021-11-22 12:03:19.200 JupyterHub application:90] Bad config encountered during initialization: The ‘authenticator_class’ trait of <main.JupyterHub object at 0x7f28f60dcb50> instance must be a type, but ‘oauthenticator.awscognito.AWSCognitoAuthenticator’ could not be imported
Here’s how I setup the SSL and cognito integration:
sudo tljh-config set https.enabled true
sudo tljh-config set https.letsencrypt.emal me@me.com
sudo tljh-config add-item https.letsencrypt.domains
sudo tljh-config add-item https.letsencrypt.domains
sudo tljh-config reload proxy
create conf file:
sudo vi /etc/systemd/system/jupyterhub.service.d/jupyterhub.conf
With these contents:
[Service]
Environment=AWSCOGNITO_DOMAIN=
#create awscognito.py
sudo vi /opt/tljh/config/jupyterhub_config.d/awscognito.py
with these contents:
##############################################
Setup aws Cognito Authenticator
##############################################
AWSCognitoAuthenticator.client_id=‘abc’
AWSCognitoAuthenticator.client_secret=‘xyz’
AWSCognitoAuthenticator.oauth_callback_url=’’
AWSCognitoAuthenticator.username_key=‘email’
AWSCognitoAuthenticator.oauth_logout_redirect_url=’’
These instructions alone worked for the server that didn’t have conda and python setup in advance.
I also tried this, but everything was already installed:
pip install -U oauthenticator
I also tried updating the symlinks for python and pip under the the tljh install to point at the conda python installation - also to no avail.
Note that the first instance was installed several weeks ago, and is on python version 3.6.9 and the latter is on python version 3.8.8
Can anyone help me understand what I’m missing here?