Refresh token
Access tokens expire, but some grant types generate refresh tokens, which clients can use to obtain new access tokens without redirecting the user.
-
The application initiates a token refresh by sending a POST request to the token endpoint to exchange the user's refresh token for an access token. This request must be authenticated (basic authentication) using the client ID and secret.
Sample request:
curl -X POST -u appdirect-49:9vY0s4yb2pbnP7Vz -H 'Content-Type: application/x-www-form-urlencoded' "https://marketplace.example.com/oauth2/token" -d "grant_type=refresh_token&refresh_token=qsdfbasfsa1bjbfdjbfs&scope=ROLE_USER%20ROLE_BILLING_ADMIN"
Parameter Description grant_type Must be refresh_token, which indicates that this is the Refresh Token grant type. refresh_token The user's refresh token. scope A space-separated list of requested scopes. -
The access token is returned.
Sample response:
{
"access_token": "EgLvB5pQZMkWl6diDYfg",
"token_type": "bearer",
"expires_in": 43199,
"scope": "ROLE_USER ROLE_BILLING_ADMIN"
}
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!