[8.0] Upgrade to league/oauth2-server 8.0 #1050
Merged
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.
This PR updates the league/oauth2-server package to 8.0 and updates Passport to be compatible with it.
The changes are documented in the upgrade guide. The things I had to change for Passport are:
Set the
AccessToken
client
property when creating an access token. This isn't documented in the upgrade guide, but the server no longer callssetClient
before callinggetClient
. To prevent a fatal error we need to set the client before returning the token fromAccessTokenRepository::getNewToken
.Set the
Client
isConfidential
property when creating a client. The League server checks this property to determine if it should validate the client secret. This will always be true for now; I'm going to add support for public clients in a separate PR.Split the
ClientRepository::getClientEntity
method into two methods,getClientEntity
andvalidateClient
. The league server callsvalidateClient
for all grants except for implicit grants and authorization code clients when the client does not have a secret.Pass a
DateTimeImmutable
instead ofDateTime
toAccessToken::setExpiryDateTime
. This only affected a test.This PR adds PKCE support (#837) but it's not really useful until Passport supports public clients. As mentioned above I'm working on a separate PR to support public clients.
In addition to running the test suite I manually tested this with all of the grant types and tested PCKE support.