Add support for authorization code grant with PKCE for distributed apps#1067
Open
ls-sean-fraser wants to merge 1 commit intobshaffer:mainfrom
Open
Add support for authorization code grant with PKCE for distributed apps#1067ls-sean-fraser wants to merge 1 commit intobshaffer:mainfrom
ls-sean-fraser wants to merge 1 commit intobshaffer:mainfrom
Conversation
move handlers for code challenge from OIDC Authorization Controller to the base authorization controller, so that non-OIDC flows can leverage it as well Add mechanism to enforce PKCE code challenges for public clients Add mechanism to configure supported code challenge methods change code_verifier comparison to use hash_equals() to avoid timing attacks added tests for all PKCE code challenge flows
ls-sean-fraser
commented
Jun 7, 2024
| 'require_exact_redirect_uri' => true, | ||
| 'redirect_status_code' => 302, | ||
| 'enforce_pkce' => false, | ||
| 'enforce_pkce_for_public_clients' => false, |
Author
There was a problem hiding this comment.
ℹ️ this should probably default to true for new installs, but that could be a breaking change for existing installs. Leaving this at false allows for releasing as a minor version. Would recommend defaulting to true for the next major version.
Comment on lines
+376
to
+377
| if ($this->clientStorage instanceof ClientCredentialsInterface) { | ||
| $isPublic = $this->clientStorage->isPublicClient($client_id); |
Author
There was a problem hiding this comment.
ℹ️ not sure why there are two interfaces, but the property is only typed to the higher level one which doesn't have the method we need.
| /** | ||
| * @var mixed | ||
| */ | ||
| protected $code_challenge; |
Author
There was a problem hiding this comment.
ℹ️ these properties and their behavior moved to the parent class
| 'require_exact_redirect_uri' => true, | ||
| 'allow_implicit' => false, | ||
| 'enforce_pkce' => false, | ||
| 'enforce_pkce_for_public_clients' => false, |
Author
There was a problem hiding this comment.
ℹ️ same comment about default value
Author
|
@bshaffer any chance you could give this PR a glance? |
Owner
|
@ls-sean-fraser will do! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for "Authorization Code Grant with PKCE" flow to allow distributed apps to securely authenticate with an OAuth server without needing to embed secrets within the distributed application, as these can be easily exposed by decompiling the application binaries.
Reference: