Problem/Motivation

When an access token expires, the refresh_token Grant service can refresh it to create new valid access token. However, when called from Oauth2ClientService::getAccessToken() the $accessToken is overwritten by the void return value of Oauth2ClientGrantServiceInterface::getAccessToken()

Proposed resolution

Oauth2ClientService::getAccessToken() returns the refreshed access token.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new747 bytes

Attached patch updates Oauth2ClientService::getAccessToken() so the method returns the refreshed access token.

fathershawn’s picture

Assigned: Unassigned » fathershawn

  • FatherShawn committed 6548378 on 8.x-3.x
    Issue #3266050 by idebr: Oauth2ClientService::getAccessToken() does not...
fathershawn’s picture

Status: Needs review » Fixed

Nice catch! We missed that when we refactored the storage model!

Status: Fixed » Closed (fixed)

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

berdir’s picture

Note: This was undone again in #3255621: Generate access token, if Refresh token not exist, which went back to expecting that the refresh grant service returns the access token. 4.x seems to have it fixed, so won't bother to open a new issue, this is just a workaround while we work on updating our site.

fathershawn’s picture

Ooh! sorry for the regression @Berdir and thanks for the patch to help those who need it get to 4.x :-)