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
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | oauth2_client-reretrieve-access-token-3266050.patch | 750 bytes | berdir |
| #2 | 3266050-2.patch | 747 bytes | idebr |
Comments
Comment #2
idebr commentedAttached patch updates Oauth2ClientService::getAccessToken() so the method returns the refreshed access token.
Comment #3
fathershawnComment #5
fathershawnNice catch! We missed that when we refactored the storage model!
Comment #7
berdirNote: 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.
Comment #8
fathershawnOoh! sorry for the regression @Berdir and thanks for the patch to help those who need it get to 4.x :-)