Problem/Motivation
I wanted to add an Access Check handler to allow _oauth_scope to be added on route requirements. However, there was no easy way to get the scopes from a request without re-implementing part of the OAuth2DrupalAuthProvider service.
Since that service is very specialised, it makes sense to extract the useful parts of that method into a separate service and expose that instead.
Steps to reproduce
N.a.
Proposed resolution
Implement an OAuth2Helper service that contains methods to retrieve the token and scopes from a request.
Remaining tasks
Review
User interface changes
None
API changes
The OAuth2DrupalAuthProvider no longer contains the protected getInfoToken method.
A new oauth2_server.oauth_helper service exists that allows you to easily fetch OAuth2 related data from a request.
Data model changes
None
Comments
Comment #2
kingdutchComment #3
nachosalvador commentedRerolled
Comment #4
sanduhrsComment #5
sanduhrsComment #7
sanduhrsThat is great!
Thanks for the patch, committed to -dev.