fix: add code_challenge_methods_supported to discovery endpoint (#43)

* fix: add code_challenge_methods_supported to discovery endpoint

* fix mock
This commit is contained in:
Livio Amstutz 2020-08-20 16:27:51 +02:00 committed by GitHub
parent 5a8e69978f
commit 57cf8ee9c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 0 deletions

View file

@ -28,6 +28,7 @@ func CreateDiscoveryConfig(c Configuration, s Signer) *oidc.DiscoveryConfigurati
IDTokenSigningAlgValuesSupported: SigAlgorithms(s),
SubjectTypesSupported: SubjectTypes(c),
TokenEndpointAuthMethodsSupported: AuthMethods(c),
CodeChallengeMethodsSupported: CodeChallengeMethods(c),
}
}
@ -117,3 +118,11 @@ func AuthMethods(c Configuration) []string {
}
return authMethods
}
func CodeChallengeMethods(c Configuration) []string {
codeMethods := make([]string, 0, 1)
if c.CodeMethodS256Supported() {
codeMethods = append(codeMethods, CodeMethodS256)
}
return codeMethods
}