Closed mitar closed 9 months ago
Oh, I can use provider.Claims
to extract that:
var claims struct {
CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"`
}
err := provider.Claims(&claims)
if err != nil {
panic(err)
}
supportsPKCE := slices.Contains(claims.CodeChallengeMethodsSupported, "S256")
By at least extracting
code_challenge_methods_supported
we could know if the provider supports PKCE. Then one can useoauth2.S256ChallengeOption
to add challenge to theAuthCodeURL
.