Skip to content
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

Should username be editable? #464

Closed
pgleeson opened this issue Apr 22, 2022 · 7 comments · Fixed by #505
Closed

Should username be editable? #464

pgleeson opened this issue Apr 22, 2022 · 7 comments · Fixed by #505
Assignees
Labels
C: backend backend related C: frontend frontend related C: User management Related to user and group management

Comments

@pgleeson
Copy link
Member

In the Edit my profile dialog, you can change your username. Is this by design? I know the long keycloak id is the unique key, but is there anywhere else a changed username will cause issues?

@sanjayankur31
Copy link
Collaborator

Changing usernames is quite a can of worms. For example---if I change my username, does that mean someone else can then use my previous one or should it be blocked for some time. It can be done, but it isn't as simple as just changing an entry in the db---it'll require a lot more thought.

This was also discussed in the Fedora community for their new auth system, so you can see the discussion here (they use IPA as their backend etc. but the general issues are the same):

fedora-infra/noggin#105

@sanjayankur31 sanjayankur31 added C: backend backend related C: frontend frontend related C: User management Related to user and group management labels Apr 22, 2022
@filippomc
Copy link
Contributor

Should we disallow username change?

@sanjayankur31
Copy link
Collaborator

Probably the best thing to do for the moment. We can revisit this later if we get requests from users to change usernames?

@filippomc
Copy link
Contributor

I'm for disallowing the change for now too as I don't really it as a feature worth supporting. As Padraig points out is not a relationship key so shouldn't be troublesome in general, but we may need to check some edge cases where the username may be cached in the frontend

@filippomc
Copy link
Contributor

Agreed that username should be shown and be greyed out in the edit form.
Need also to fix the email as it is not shown in the form and be editable.

@sanjayankur31
Copy link
Collaborator

Need also to fix the email as it is not shown in the form and be editable.

Was looking into this. The client.get_current_user() call here is always throwing a "404: user not found" exception here, so the e-mail is always cleared in the except block, even when I'm logged in.

https://github.com/OpenSourceBrain/OSBv2/blob/develop/applications/accounts-api/backend/accounts_api/services/user_service.py#L27

I looked at the cloudharness code, and it looks like an authentication_token is necessary for the user look up? If no token is provided, it returns -1 as a userid. Does this mean that to do the check and strip out the e-mail here, we need to also make this call a private one that requires authentication?

https://github.com/MetaCell/cloud-harness/blob/324ea0f0978fe31a1dcd21ee3138b9df230a3f29/libraries/cloudharness-common/cloudharness/auth/keycloak.py#L92

@sanjayankur31 sanjayankur31 linked a pull request May 26, 2022 that will close this issue
filippomc added a commit that referenced this issue May 31, 2022
feat(user-editor): disable username field (fixes #464)
@pgleeson
Copy link
Member Author

pgleeson commented Aug 5, 2022

Username not editable now

@pgleeson pgleeson closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: backend backend related C: frontend frontend related C: User management Related to user and group management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants