Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Native Authenticator not working after configuration #1018

Open
piskernik opened this issue Jan 6, 2025 · 1 comment
Open

Native Authenticator not working after configuration #1018

piskernik opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@piskernik
Copy link

Bug description

In Issue 295 a workaround was stated, to bring Native Authenticator to work, however som critical additional information is missing

How to reproduce

apt-get update && apt-get upgrade
apt install python3 python3-dev git curl
curl -L https://tljh.jupyter.org/bootstrap.py | sudo -E python3 - --admin adminusername
sudo tljh-config set auth.type nativeauthenticator.NativeAuthenticator
sudo tljh-config set auth.NativeAuthenticator.admin_users adminusername
sudo tljh-config set auth.NativeAuthenticator.allow_all True
sudo tljh-config reload

This will not allow login of the adminusername.

Work-around

In contrast you need to do the following:

apt-get update && apt-get upgrade
apt install python3 python3-dev git curl
curl -L https://tljh.jupyter.org/bootstrap.py | sudo -E python3 - --admin adminusername
sudo tljh-config set auth.type nativeauthenticator.NativeAuthenticator
sudo tljh-config set auth.NativeAuthenticator.admin_users otheradminusername
sudo tljh-config set auth.NativeAuthenticator.allow_all True

Then cd /opt/tljh/config/jupyterhub_config.d/ and create a new file:

nano NativeAuthenticator.py

Paste this into it:

import os, nativeauthenticator
c.JupyterHub.template_paths = [f"{os.path.dirname(nativeauthenticator.__file__)}/templates/"]

Save it with CTRL-X and Yes and then sudo tljh-config reload

Now REGISTER as new user with otheradminusername. 
You will get access.

### Expected behavior
Of course it would be good, if no workaround would be necessary. At least the workaround should be described in the documentation for native authenticator.
@piskernik piskernik added the bug Something isn't working label Jan 6, 2025
@piskernik
Copy link
Author

The reason is, that the jupyterhub.sqlite database in /opt /tljh/state is not prepopulated with the existing user, when the change to Native Authenticator occurs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant