Skip to content
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

Backport of oidc/provider: adds code_challenge_methods_supported to metadata into release/1.15.x #24985

Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions changelog/24979.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
oidc/provider: Adds `code_challenge_methods_supported` to OpenID Connect Metadata
```
5 changes: 5 additions & 0 deletions vault/identity_store_oidc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions vault/identity_store_oidc_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,12 @@ $ curl \
"client_secret_basic",
"client_secret_post",
"none"
]}
],
"code_challenge_methods_supported": [
"plain",
"S256"
]
}
```

## Read provider public keys
Expand Down
4 changes: 4 additions & 0 deletions website/content/docs/secrets/identity/oidc-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
```
Expand Down
Loading