-
Notifications
You must be signed in to change notification settings - Fork 897
feat: allow configurable username claim field in OIDC #5507
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
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
5f683fc
to
415439b
Compare
I have read the CLA Document and I hereby sign the CLA |
415439b
to
6c47ef8
Compare
@whitney-coder as requested I tag you here. This would really help everyone trying to use gitlab as opened connect provider. As they use the nickname claim to publish the username: https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/initializers/doorkeeper_openid_connect.rb#L35 |
@bpmct tagging you here to get your eyes/thoughts on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! You'll have to run make update-golden-files
to update the CLI golden file.
cli/root_test.go
Outdated
@@ -124,6 +124,7 @@ ExtractCommandPathsLoop: | |||
require.NoError(t, err, "read golden file, run \"make update-golden-files\" and commit the changes") | |||
// Remove CRLF newlines (Windows). | |||
want = bytes.ReplaceAll(want, []byte{'\r', '\n'}, []byte{'\n'}) | |||
fmt.Printf(string(got)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf(string(got)) |
Oh that printf slipped through, I'll fix this as soon as I'm on my laptop again. I just couldn't get this make target to run that's why I've manually created the change for the golden file. |
Gitlab does not set the preferred_username field. Therefore, coder generates something from the users email address, which is not very helpful. This allows the administrator to change the field used for the username (e.g. to "nickname") Signed-off-by: Jan Losinski <[email protected]>
6c47ef8
to
d10b30f
Compare
@coadler I've removed the printf. If I try to generate the golden files I get this:
|
@coadler is there anyhing I can do? |
@janLo do you mind if I push to your branch to fix the CI failures? |
Not at all! Thank you! |
Thanks! 🎉 |
Gitlab does not set the preferred_username field.
Therefore, coder generates something from the user's email address, which is not very helpful. This allows the administrator to change the field used for the username (e.g. to "nickname")