Screenshot New Years Sale Get the "ALL ACCESS PASS" and Save $349. Unlimited Licenses.
Show All Access Pass

Refresh Token

Published: October 2, 2018 | Updated: October 2nd, 2018
  1. Home
  2. Docs
  3. General
  4. Grant Types
  5. Refresh Token

Refresh tokens are used as a way to gain a new access token after the original access token has expired.

What is Needed?

If you are using a refresh token, this article is going to assume that a general understanding of what a refresh token is and how to use the OAuth2 endpoints.

Endpoint

HTTP/1.1 POST

/oauth/token
/oauth?=token

Parameters

  • (required) grant_type – “refresh_token”
  • (required) refresh_token – A Valid Refresh Token.
https://your-server.com/oauth/token?grant_type=refresh_token&refresh_token=xxx

 

The Return

The server will return JSON containing the following values on a successful refresh token request.

 

Parameters

  • access_token – A new access token
  • expires_in – The length of seconds from the time the access token was issued until the access_token becomes invalid.
  • token_type
  • scope
  • *refresh_token – A new refresh token

* If a new refresh token is wanted in the return, the filter below will need to be added to your theme’s function file.

add_filter( 'wo_always_issue_new_refresh_token', '__return_true' );

 

Return

{
"access_token": "nziindid3if24vrjbp6cdzyxiuybrcjjsd6grks7",
"expires_in": 234234,
"token_type": "Bearer",
"scope": "basic"
"request_token": "khaskdjhkhasdnaiwbwsh123"
}
Icon