Skip to content

Commit

Permalink
backport of commit 677d98a
Browse files Browse the repository at this point in the history
  • Loading branch information
austingebauer authored Jan 22, 2024
1 parent 2a72f2a commit bb1d38a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
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
7 changes: 6 additions & 1 deletion website/content/api-docs/secret/identity/oidc-provider.mdx
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

0 comments on commit bb1d38a

Please sign in to comment.