authenticator reference doc: update authenticate return

This commit is contained in:
Simon Li
2023-11-16 19:16:54 +00:00
parent 29bb4b8032
commit 99d72dfccf

View File

@@ -65,11 +65,15 @@ from JupyterHub's login form. Unless the login form has been customized,
- `username` - `username`
- `password` - `password`
The `authenticate` method's job is simple: If authentication is successful the `authenticate` method must return either:
- return the username (non-empty str) of the authenticated user if - the username (non-empty str) of the authenticated user
authentication is successful - or a dictionary with fields:
- return `None` otherwise - `name`: the username
- `auth_state`: optional, a dictionary of of [auth state that will be persisted](authenticator-auth-state)
- `groups`: optional, a list of JupyterHub [group memberships](authenticator-groups)
Otherwise, it must return `None`.
Writing an Authenticator that looks up passwords in a dictionary Writing an Authenticator that looks up passwords in a dictionary
requires only overriding this one method: requires only overriding this one method:
@@ -182,6 +186,8 @@ Additionally, configurable attributes for your authenticator will
appear in jupyterhub help output and auto-generated configuration files appear in jupyterhub help output and auto-generated configuration files
via `jupyterhub --generate-config`. via `jupyterhub --generate-config`.
(authenticator-auth-state)=
### Authentication state ### Authentication state
JupyterHub 0.8 adds the ability to persist state related to authentication, JupyterHub 0.8 adds the ability to persist state related to authentication,