-
Notifications
You must be signed in to change notification settings - Fork 183
feat(op): always verify code challenge when available #721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change AuthorizeCodeChallenge
is called 3 different times within AuthorizeCodeClient
depending on the code path.
Can we simplify the function to only do a single check, perhaps in a higher scope at the start of the AuthorizeCodeClient
function?
See how we do it in Zitadel for example:
pkg/op/token_code.go
Outdated
codeChallenge := request.GetCodeChallenge() | ||
if codeChallenge != nil && codeChallenge.Challenge != "" { | ||
err = AuthorizeCodeChallenge(tokenReq.CodeVerifier, request.GetCodeChallenge()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the codeChallenge variable here instead, no need to re-get.
Oops. responded to the wrong PR with the last comment. Disregard that please. |
Co-authored-by: Tim Möhlmann <[email protected]>
@muhlemmer
→ Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great changes, thanks!
🎉 This PR is included in version 3.37.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Finally the RFC Best Current Practice for OAuth 2.0 Security has been approved. According to the RFC: > Authorization servers MUST support PKCE [RFC7636]. > > If a client sends a valid PKCE code_challenge parameter in the authorization request, the authorization server MUST enforce the correct usage of code_verifier at the token endpoint. Isn’t it time we strengthen PKCE support a bit more? This PR updates the logic so that PKCE is always verified, even when the Auth Method is not "none".
refs: #254, #471
Finally the RFC
Best Current Practice for OAuth 2.0 Security
has been approved.According to the RFC:
Isn’t it time we strengthen PKCE support a bit more?
This PR updates the logic so that PKCE is always verified, even when the Auth Method is not "none".
Could you please review this PR?
And please let me know if there’s anything missing or if there’s anything else I should address.
Definition of Ready