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

Kingdutch created an issue. See original summary.

kingdutch’s picture

Assigned: kingdutch » Unassigned
Status: Active » Needs review
StatusFileSize
new12.4 KB
nachosalvador’s picture

StatusFileSize
new12.41 KB

Rerolled

sanduhrs’s picture

StatusFileSize
new12.42 KB
sanduhrs’s picture

StatusFileSize
new12.41 KB

  • sanduhrs committed 4503d44 on 2.0.x authored by Kingdutch
    Issue #3174298 by sanduhrs, Kingdutch, nachosalvador: Extract token...
sanduhrs’s picture

Status: Needs review » Fixed

That is great!
Thanks for the patch, committed to -dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.