mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat(coderd): set full name from IDP name claim (#13468)
* Updates OIDC and GitHub OAuth login to fetch set name from relevant claim fields * Adds CODER_OIDC_NAME_FIELD as configurable source of user name claim * Adds httpapi function to normalize a username such that it will pass validation * Adds firstName / lastName fields to dev OIDC setup
This commit is contained in:
@ -333,6 +333,7 @@ type OIDCConfig struct {
|
||||
Scopes serpent.StringArray `json:"scopes" typescript:",notnull"`
|
||||
IgnoreEmailVerified serpent.Bool `json:"ignore_email_verified" typescript:",notnull"`
|
||||
UsernameField serpent.String `json:"username_field" typescript:",notnull"`
|
||||
NameField serpent.String `json:"name_field" typescript:",notnull"`
|
||||
EmailField serpent.String `json:"email_field" typescript:",notnull"`
|
||||
AuthURLParams serpent.Struct[map[string]string] `json:"auth_url_params" typescript:",notnull"`
|
||||
IgnoreUserInfo serpent.Bool `json:"ignore_user_info" typescript:",notnull"`
|
||||
@ -1192,6 +1193,16 @@ when required by your organization's security policy.`,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "usernameField",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Name Field",
|
||||
Description: "OIDC claim field to use as the name.",
|
||||
Flag: "oidc-name-field",
|
||||
Env: "CODER_OIDC_NAME_FIELD",
|
||||
Default: "name",
|
||||
Value: &c.OIDC.NameField,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "nameField",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Email Field",
|
||||
Description: "OIDC claim field to use as the email.",
|
||||
|
Reference in New Issue
Block a user