Skip to content

Username collision #5

@Ph0tonic

Description

@Ph0tonic

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.

  1. Handle it in Jupyterhub
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions