diff --git a/changelog/24979.txt b/changelog/24979.txt new file mode 100644 index 000000000000..bbbcedce077a --- /dev/null +++ b/changelog/24979.txt @@ -0,0 +1,3 @@ +```release-note:improvement +oidc/provider: Adds `code_challenge_methods_supported` to OpenID Connect Metadata +``` \ No newline at end of file diff --git a/vault/identity_store_oidc_provider.go b/vault/identity_store_oidc_provider.go index 9e0a6b151e82..ae2b41c561ce 100644 --- a/vault/identity_store_oidc_provider.go +++ b/vault/identity_store_oidc_provider.go @@ -166,6 +166,7 @@ type providerDiscovery struct { Subjects []string `json:"subject_types_supported"` GrantTypes []string `json:"grant_types_supported"` AuthMethods []string `json:"token_endpoint_auth_methods_supported"` + CodeChallengeMethods []string `json:"code_challenge_methods_supported"` } type authCodeCacheEntry struct { @@ -1572,6 +1573,10 @@ func (i *IdentityStore) pathOIDCProviderDiscovery(ctx context.Context, req *logi "client_secret_basic", "client_secret_post", }, + CodeChallengeMethods: []string{ + codeChallengeMethodPlain, + codeChallengeMethodS256, + }, } data, err := json.Marshal(disc) diff --git a/vault/identity_store_oidc_provider_test.go b/vault/identity_store_oidc_provider_test.go index 0c5c780d6654..7fcc8fa48a16 100644 --- a/vault/identity_store_oidc_provider_test.go +++ b/vault/identity_store_oidc_provider_test.go @@ -3637,6 +3637,7 @@ func TestOIDC_Path_OpenIDProviderConfig(t *testing.T) { AuthMethods: []string{"none", "client_secret_basic", "client_secret_post"}, RequestParameter: false, RequestURIParameter: false, + CodeChallengeMethods: []string{codeChallengeMethodPlain, codeChallengeMethodS256}, } discoveryResp := &providerDiscovery{} json.Unmarshal(resp.Data["http_raw_body"].([]byte), discoveryResp) @@ -3693,6 +3694,7 @@ func TestOIDC_Path_OpenIDProviderConfig(t *testing.T) { AuthMethods: []string{"none", "client_secret_basic", "client_secret_post"}, RequestParameter: false, RequestURIParameter: false, + CodeChallengeMethods: []string{codeChallengeMethodPlain, codeChallengeMethodS256}, } discoveryResp = &providerDiscovery{} json.Unmarshal(resp.Data["http_raw_body"].([]byte), discoveryResp) diff --git a/website/content/api-docs/secret/identity/oidc-provider.mdx b/website/content/api-docs/secret/identity/oidc-provider.mdx index e21c5e26221c..db46867d96a3 100644 --- a/website/content/api-docs/secret/identity/oidc-provider.mdx +++ b/website/content/api-docs/secret/identity/oidc-provider.mdx @@ -605,7 +605,12 @@ $ curl \ "client_secret_basic", "client_secret_post", "none" - ]} + ], + "code_challenge_methods_supported": [ + "plain", + "S256" + ] +} ``` ## Read provider public keys diff --git a/website/content/docs/secrets/identity/oidc-provider.mdx b/website/content/docs/secrets/identity/oidc-provider.mdx index 67ea8151cd36..01445d70b27e 100644 --- a/website/content/docs/secrets/identity/oidc-provider.mdx +++ b/website/content/docs/secrets/identity/oidc-provider.mdx @@ -127,6 +127,10 @@ Any Vault auth method may be used within the OIDC flow. For simplicity, enable t "none", "client_secret_basic", "client_secret_post" + ], + "code_challenge_methods_supported": [ + "plain", + "S256" ] } ```