chore(op): add test for PKCE verification

This commit is contained in:
Ayato 2025-04-29 13:07:01 +09:00
parent f8c3a2c6aa
commit 6e7d3a2d81
No known key found for this signature in database
GPG key ID: 56E05AE09DBA012D
2 changed files with 77 additions and 2 deletions

View file

@ -141,10 +141,10 @@ func AuthorizeCodeChallenge(codeVerifier string, challenge *oidc.CodeChallenge)
}
if codeVerifier == "" {
return oidc.ErrInvalidRequest().WithDescription("code_challenge required")
return oidc.ErrInvalidRequest().WithDescription("code_verifier required")
}
if !oidc.VerifyCodeChallenge(challenge, codeVerifier) {
return oidc.ErrInvalidGrant().WithDescription("invalid code challenge")
return oidc.ErrInvalidGrant().WithDescription("invalid code_verifier")
}
return nil
}