fix: add code_challenge_methods_supported to discovery endpoint

This commit is contained in:
Livio Amstutz 2020-08-20 16:18:31 +02:00
parent 5a8e69978f
commit 68033051ba
4 changed files with 18 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
}