-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hi,
Thank you very much for your work.
As previously discussed here (jupyterhub/oauthenticator#459 (comment)), we have a username collision issue to manage.
I mainly see 2 ways of managing it.
- Handle it in Jupyterhub
- Add a prefix in the authenticator's wrapper
I managed to make the second option work and opened a PR to comment #6.
For this second solution, I saw 2 main options to implement the fix, first by overriding the function normalize_username
. However, this function might be called multiple times due to the implementation inside OAuthenticator. Therefore, we can't directly add a simple prefix. We should first check if a prefix exists and be 100% sure that it's indeed a prefix. The second solution was to override authenticate
, check_allowed
and check_blocked_user
to have the prefix added or removed.
The drawback of the prefix is that it is displayed on jupyterhub page in the top right corner with the prefix.
I had a look at how to handle the name collision in Jupyterhub directly and if we want to do that, I think that we should change the database to store in the user table an additional field named authenticator
. And during the authentication, instead of returning a single username or an object with 2 fields name
and admin
(to be check). We could also return an additional field named authenticator.
Jupyterhub code to check user duplication :
https://github.com/jupyterhub/jupyterhub/blob/29e954c407c017c045fc534410ffcd1ec6318727/jupyterhub/apihandlers/users.py#L333