mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow configuring OIDC email claim and OIDC auth url parameters (#6867)
This commit: - Allows configuring the OIDC claim Coder uses for email addresses (by default, this is still email) - Allows customising the parameters sent to the upstream identity provider when requesting a token. This is still access_type=offline by default. - Updates documentation related to the above.
This commit is contained in:
+25
-4
@@ -255,6 +255,8 @@ type OIDCConfig struct {
|
||||
Scopes clibase.StringArray `json:"scopes" typescript:",notnull"`
|
||||
IgnoreEmailVerified clibase.Bool `json:"ignore_email_verified" typescript:",notnull"`
|
||||
UsernameField clibase.String `json:"username_field" typescript:",notnull"`
|
||||
EmailField clibase.String `json:"email_field" typescript:",notnull"`
|
||||
AuthURLParams clibase.Struct[map[string]string] `json:"auth_url_params" typescript:",notnull"`
|
||||
GroupField clibase.String `json:"groups_field" typescript:",notnull"`
|
||||
GroupMapping clibase.Struct[map[string]string] `json:"group_mapping" typescript:",notnull"`
|
||||
SignInText clibase.String `json:"sign_in_text" typescript:",notnull"`
|
||||
@@ -845,10 +847,9 @@ when required by your organization's security policy.`,
|
||||
Description: "Ignore the email_verified claim from the upstream provider.",
|
||||
Flag: "oidc-ignore-email-verified",
|
||||
Env: "CODER_OIDC_IGNORE_EMAIL_VERIFIED",
|
||||
|
||||
Value: &c.OIDC.IgnoreEmailVerified,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "ignoreEmailVerified",
|
||||
Value: &c.OIDC.IgnoreEmailVerified,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "ignoreEmailVerified",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Username Field",
|
||||
@@ -860,6 +861,26 @@ when required by your organization's security policy.`,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "usernameField",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Email Field",
|
||||
Description: "OIDC claim field to use as the email.",
|
||||
Flag: "oidc-email-field",
|
||||
Env: "CODER_OIDC_EMAIL_FIELD",
|
||||
Default: "email",
|
||||
Value: &c.OIDC.EmailField,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "emailField",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Auth URL Parameters",
|
||||
Description: "OIDC auth URL parameters to pass to the upstream provider.",
|
||||
Flag: "oidc-auth-url-params",
|
||||
Env: "CODER_OIDC_AUTH_URL_PARAMS",
|
||||
Default: `{"access_type": "offline"}`,
|
||||
Value: &c.OIDC.AuthURLParams,
|
||||
Group: &deploymentGroupOIDC,
|
||||
YAML: "authURLParams",
|
||||
},
|
||||
{
|
||||
Name: "OIDC Group Field",
|
||||
Description: "Change the OIDC default 'groups' claim field. By default, will be 'groups' if present in the oidc scopes argument.",
|
||||
|
||||
Reference in New Issue
Block a user