feat(op): PKCE Verification in Legacy Server when AuthMethod is not NONE and CodeVerifier is not Empty (#496)

* add logic for legacy server pkce verification when auth method is not None, and code verifier is not empty.

* update per Tim's direction
This commit is contained in:
Stephen Andary 2023-12-07 10:36:03 -05:00 committed by GitHub
parent ed21cdd4ce
commit 9d12d1d900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,7 +205,7 @@ func (s *LegacyServer) CodeExchange(ctx context.Context, r *ClientRequest[oidc.A
if err != nil {
return nil, err
}
if r.Client.AuthMethod() == oidc.AuthMethodNone {
if r.Client.AuthMethod() == oidc.AuthMethodNone || r.Data.CodeVerifier != "" {
if err = AuthorizeCodeChallenge(r.Data.CodeVerifier, authReq.GetCodeChallenge()); err != nil {
return nil, err
}