You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.

Refresh Access Token

oauth2/refresh-token@1.0.1
3 providers

Get Access Token from Refresh Token

Issue a new access token based on previously issued refresh token for OAuth 2.0 compatible providers. Client authentication can be provided directly as input, or, if supported, set as provider parameter.

Input
Refresh Token
Client ID
Client Secret
Result
Access Token
Expires in (seconds)
Scopes
Token type
Refresh token

1.Choose a provider

2.Use GetAccessTokenFromRefreshToken with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk

Structure details

Input (object)

refreshToken
The refresh token previously issued to the client.
clientId
Client authentication; may be also accepted as provider parameter.
clientSecret
Client authentication; may be also accepted as provider parameter.

Example

Result (object)

accessToken
Newly issued access token
expiresIn
Duration of time the access token is granted for.
scopes
Authorized scopes for the issued access token.
tokenType
The type of token this is, usually "Bearer".
refreshToken
Provider may issue a new refresh token, invalidating the previously used refresh token

Example

Implementation details

Provider
mock
Use case
GetAccessTokenFromRefreshToken
Author
@superface
Source
Verified