NativeAuthenticator doesnt let me admin login

Hello guys,

I have build a Docker Image from the official quay.io JupyterHub image using DockerSpawner and NativeAuthenticator. On the DockerSpawner side everything seems working, but the NativeAuthenticator won’t let me log in using the Admin account. I start the Container, open the website on localhost, signed up my admin account ‘myadmin’ and try to log in but it always spits out:

) 31.01ms
jupyterhub-1  | [W 2024-09-27 11:34:06.510 JupyterHub base:979] Failed login for myadmin
jupyterhub-1  | [I 2024-09-27 11:34:06.515 JupyterHub log:192] 200 POST /hub/login?next=%2Fhub%2F (@::ffff:172.21.0.1) 14.55ms

Therefore here is the Jupyterhub Config:

from dockerspawner import DockerSpawner
from nativeauthenticator import NativeAuthenticator
import os

c.JupyterHub.authenticator_class = NativeAuthenticator


c.GenericOAuthenticator.enable_auth_state = True
c.Spawner.http_timeout = 300
c.JupyterHub.log_level = 'DEBUG'
c.JupyterHub.hub_ip = '0.0.0.0'

c.DockerSpawner.network_name = 'jupyterhub'

c.DockerSpawner.remove = True

c.JupyterHub.spawner_class = DockerSpawner
c.NativeAuthenticator.create_system_users = True


notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work'
c.DockerSpawner.notebook_dir = notebook_dir

c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }
c.DockerSpawner.image = "jupyter/datascience-notebook:latest"

# Persistence
c.JupyterHub.db_url = "sqlite:///data/jupyterhub.sqlite"

# Enable user registration
c.Authenticator.allowed_users = set()
c.Authenticator.admin_users = {'myadmin'}
c.NativeAuthenticator.open_signup = True

Thanks for any help in advance :slight_smile: !

There’s some inconsistency in how JupyterHub authenticators behave. OAuthenticator allows admin_users to login, others including NativeAuthenticator use the default behaviour which is that admin_users only grant admin permission, it doesn’t allow the user to login, so they need to be added to allowed_users.

I’ve created an issue to discuss this: