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

Skip to content

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

Merged
merged 5 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix golden file
  • Loading branch information
coadler committed Jan 4, 2023
commit 3243913d91e80640d08a21a4dc328e49f1e2c672
4 changes: 2 additions & 2 deletions cli/deployment/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func newConfig() *codersdk.DeploymentConfig {
Default: false,
},
UsernameField: &codersdk.DeploymentConfigField[string]{
Name: "OIDC Username field",
Usage: "OIDC claim filed to use as user-name.",
Name: "OIDC Username Field",
Usage: "OIDC claim field to use as the username.",
Flag: "oidc-username-field",
Default: "preferred_username",
},
Expand Down
7 changes: 3 additions & 4 deletions cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ Flags:
OIDC.
Consumes $CODER_OIDC_SCOPES (default
[openid,profile,email])
--oidc-username-field string OIDC claim filed to use as user-name.
Consumes
$CODER_OIDC_USERNAME_FILED (default
"preferred_username")
--oidc-username-field string OIDC claim field to use as the username.
Consumes $CODER_OIDC_USERNAME_FILED
(default "preferred_username")
--postgres-url string URL of a PostgreSQL database. If empty,
PostgreSQL binaries will be downloaded
from Maven
Expand Down
3 changes: 2 additions & 1 deletion coderd/userauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ type OIDCConfig struct {
// IgnoreEmailVerified allows ignoring the email_verified claim
// from an upstream OIDC provider. See #5065 for context.
IgnoreEmailVerified bool
// UsernameField selects the claim field to be used as username
// UsernameField selects the claim field to be used as the created user's
// username.
UsernameField string
}

Expand Down