Skip to content

Allowing users to update their name #1514

New issue

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

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

Already on GitHub? Sign in to your account

Open
brichet opened this issue Apr 18, 2025 · 3 comments · May be fixed by #1518
Open

Allowing users to update their name #1514

brichet opened this issue Apr 18, 2025 · 3 comments · May be fixed by #1518

Comments

@brichet
Copy link
Contributor

brichet commented Apr 18, 2025

Problem

When using jupyter-collaboration, it could be helpful to distinguish users from their names. Several features/applications could benefit from it, like collaborative edition, suggestions or chat.

AFAIU, the user name is provided by JupyterHub (cookie) or generated as an Anonymous one.

In the case of an generated one, it is not possible to change it from the UI, but there is also no method to update it from the API.

Would it make sense to make the user name editable in certain situation ?

Proposed Solution

  • Add a config entry to allow editing the names. Maybe this could be automatically disabled if using JupyterHub (not sure how).
  • Add a put method in the api/me handler to update the user name if the flag is true. Probably we should ensure that the username property cannot be updated, as this property must be the one used across applications to distinguish users from each others.

Additional context

Related issues:

It has also been briefly discussed during a frontend weekly meeting, and this solution has been suggested by @krassowski.

@minrk
Copy link
Contributor

minrk commented Apr 22, 2025

I'm not 100% sure it should be config or just an attribute of the IdentityProvider (it should not be configurable for the JupyterHub class, for example), but the idea makes perfect sense.

There are implications around the display name, because if it's totally unrestricted, that means users will be able to impersonate each other. I guess that's okay for anonymous access, though.

Does it make sense for the IdentityProvider to specify which identity fields can be set? For example, color should probably ~always be settable, username never, display name and avatar_url will depend on the implementation whether they should be allowed or not. Then a PUT or PATCH to /api/me to set one or more fields?

@brichet
Copy link
Contributor Author

brichet commented Apr 24, 2025

Thanks @MinKR for your feedback.

I'm not 100% sure it should be config or just an attribute of the IdentityProvider (it should not be configurable for the JupyterHub class, for example)

Does JupyterHub provides its own IdentityProvider ? Can we assume that the default one (it seems to be PasswordIdentityProvider) is the one used when there is no authentication system ?

There are implications around the display name, because if it's totally unrestricted, that means users will be able to impersonate each other. I guess that's okay for anonymous access, though.

I was assuming that there is no guaranty about the identity in this use case, but it's mostly in collaborating context. If there is a need for guaranties, then we should use an authentication system.

Does it make sense for the IdentityProvider to specify which identity fields can be set? For example, color should probably ~always be settable, username never, display name and avatar_url will depend on the implementation whether they should be allowed or not. Then a PUT or PATCH to /api/me to set one or more fields?

Can you see situations where some field should not be set while other could, except for the username ?

@minrk
Copy link
Contributor

minrk commented Apr 25, 2025

Does JupyterHub provides its own IdentityProvider ?

Yes, it does.

Can we assume that the default one (it seems to be PasswordIdentityProvider) is the one used when there is no authentication system ?

Approximately, yes.

Can you see situations where some field should not be set while other could, except for the username ?

Yes, often display name should not be set, and in general any fields the IdentityProvider itself understands (likely avatar url, name, possibly initials) or has a source of information for should not be settable. But fields that are specific to Jupyter (like color) are rarely going to come from the identity provider, so should be fine to leave settable. A list/set of readonly (or writable for the inverse) fields on the identity provider might suffice.

To be clear, I'm not arguing against setting any fields, just making sure we do this in a way that IdentityProvider implementations and/or config have control over which fields are settable. E.g. one might want to use the default IdentityProvider while preventing spoofing by limiting display names. Maybe that's config, maybe it requires a subclass, but whatever it is, it should still be possible.

@brichet brichet linked a pull request Apr 29, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants