Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

fix(oauth): Provider username is ignored when signing up using OAuth#511

Merged
stonith404 merged 2 commits into
stonith404:mainfrom
marvinruder:marvinruder/issue505
Jul 1, 2024
Merged

fix(oauth): Provider username is ignored when signing up using OAuth#511
stonith404 merged 2 commits into
stonith404:mainfrom
marvinruder:marvinruder/issue505

Conversation

@marvinruder
Copy link
Copy Markdown
Contributor

Fixes #505

@marvinruder
Copy link
Copy Markdown
Contributor Author

Should we also change the priority order of provider usernames?

const username = claim
? idTokenData[claim]
: idTokenData.name ||
idTokenData.nickname ||
idTokenData.preferred_username;

If we receive a preferred_username from the provider, we should probably prefer it over the name or nickname.

@stonith404
Copy link
Copy Markdown
Owner

Thank you very much for your PR, and I apologize for the delayed response.

I think this change makes absolutely sense but there’s a potential issue with username conflicts since Pingvin Share supports multiple authentication methods. I would suggest attempting the sign-up with the provider’s username, and if it fails due to a conflict, we can then use the getAvailableUsername method to generate a unique username and proceed with the sign-up process. What do you think?

And yes, prioritizing preferred_username makes sense. I'm not sure why we prioritize the name and nickname.

* Reprioritize claims for OIDC provider username

Signed-off-by: Marvin A. Ruder <[email protected]>
@stonith404 stonith404 merged commit 31366d9 into stonith404:main Jul 1, 2024
@marvinruder marvinruder deleted the marvinruder/issue505 branch July 1, 2024 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Provider username is ignored when signing up using OAuth

2 participants