Refreshed access_token is missing scope with league/oauth2-server ^9

Created on 6 March 2025, about 1 month ago

Problem/Motivation

Simple OAuth 6.0.0-beta9 updated the league/oauth2-server version to ^9.0. This update seems to be breaking this module's ability to refresh tokens. The initial access_token works fine, but when a refresh_token is used to get a new one, the new access_token does not have any scope associated with it. See attached screenshot from my local development instance's /admin/config/people/simple_oauth/oauth2_token.

The same exact requests for tokens on another Drupal site with league/oauth2-server version 8.5.5 works as expected (the scope is saved on both access_tokens. See second screenshot.

This is critical because it means that updating to OAuth 6.0.0-beta9+ causes all password grant tokens to lose their scopes, requiring them to be reauthorized from the start.

Steps to reproduce

  • Request an access token via password grant.
  • Observe that the scope is set properly.
  • Request a new access token using the refresh token.
  • Observe that no scope is set.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024