Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.
▸ refreshTokenGrant(config
, refreshToken
, parameters
?, options
?): Promise
<TokenEndpointResponse
& TokenEndpointResponseHelpers
>
Performs an OAuth 2.0 Refresh Token Grant at the Authorization
Server's token endpoint using parameters
from the parameters
argument, allowing a client to obtain a new access
token using a valid refresh token.
Note: URL of the authorization server's token endpoint must be configured.
Parameter | Type | Description |
---|---|---|
config |
Configuration |
- |
refreshToken |
string |
OAuth 2.0 Refresh Token provided by the authorization server that is used to obtain a new access token. |
parameters ? |
Record <string , string > | URLSearchParams |
Additional parameters that will be sent to the token endpoint, typically used for parameters such as scope and a resource (Resource Indicator) |
options ? |
DPoPOptions |
- |
Promise
<TokenEndpointResponse
& TokenEndpointResponseHelpers
>
Requesting a new Access Token using the Refresh Token Grant with a
scope
and a resource
(Resource Indicator)
parameters.
let config!: client.Configuration
let refreshToken!: string
let scope!: string
let resource!: string
let tokenEndpointResponse = await client.refreshTokenGrant(
config,
refreshToken,
{
scope,
resource,
},
)