Problem/Motivation

client_credentials standard does not have refreshToken. Expired token is usually renew by requesting a new access token directly. There is no handling for expired access token in getClientCredentialsAccessToken(). This means expired token in client_credentials grant will not be renew automatically.

Proposed resolution

Add support for renewing expired token to getClientCredentialsAccessToken()

Comments

longmtran created an issue. See original summary.

longmtran’s picture

Attached patch adds token renewal support to getClientCredentialsAccessToken()

longmtran’s picture

Status: Active » Needs review
ivan.chavarro’s picture

Thank you, this patch solved my issue.

sfuchsbe’s picture

Works like a charm. Thank you

Myddna’s picture

Could this patch be commited, please? :)

jumoke’s picture

Works for me.

jumoke’s picture

Status: Needs review » Reviewed & tested by the community
fathershawn’s picture

Hi! @perelesnyk and I have stepped up as maintainers, officially for D9 compatible and forward. I've added this issue to our planning issue. The Oauth2 standard has Refresh tokens as optional in general:

Issuing a refresh token is optional at the discretion of the authorization server. If the authorization server issues a refresh token, it is included when issuing an access token

https://tools.ietf.org/html/rfc6749#section-1.5

So if a refresh token is returned with the original access token, we should use it on all grant types

fathershawn’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
fathershawn’s picture