Added ability to restrict scopes for a client #747
Closed
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 is a partial fix for #691.
With this change the scopes which a client can issue tokens for is limited to it's own array of
scopes
. This allows scopes to be used to protect internal machine-to-machine requests from being accessed by users with valid password grant tokens.This adds functionality which exists in other PHP OAuth server implementations. e.g. https://bshaffer.github.io/oauth2-server-php-docs/overview/scope:
This implementation behaves in the same way.
One thing I noticed is that following #729 the migration to create the
oauth_clilents
table hasn't been updated to include thegrant_types
column. If this PR gets merged I'll therefore do another PR to add both thegrant_types
andscopes
columns, if that's helpful.