mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-18 18:38:08 -05:00
oidc/provider: adds code_challenge_methods_supported to metadata (#24979)
* oidc/provider: adds code_challenge_methods_supported to metadata * adds changelog * adds docs
This commit is contained in:
parent
4811fd1962
commit
677d98a821
5 changed files with 20 additions and 1 deletions
3
changelog/24979.txt
Normal file
3
changelog/24979.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
oidc/provider: Adds `code_challenge_methods_supported` to OpenID Connect Metadata
|
||||
```
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -605,7 +605,12 @@ $ curl \
|
|||
"client_secret_basic",
|
||||
"client_secret_post",
|
||||
"none"
|
||||
]}
|
||||
],
|
||||
"code_challenge_methods_supported": [
|
||||
"plain",
|
||||
"S256"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Read provider public keys
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue