Refreshing an Expired Token

In this step we show how to refresh an expired access token.


Execute the following line to load the libraries:

In [ ]:

Refreshing an access token

To obtain a new access token to replace an expired token, the client makes a POST /token request with the following parameters:

  • grant_type: The value "".
  • client_id: The unique identifier for the client given by the authorization provider.
  • client_secret: A shared secret value between the client and authorization provider.
  • domain: The service provider domain.

The client must have an existing access token for the given domain. After making this request, the previous access token is no longer valid, and is replaced by the new token.

In [ ]:"http://ap:8001/token", {
  grant_type: "",
  client_id: "<client_id>",
  client_secret: "<client_secret>",
  domain: "sp:8002"

Using the new access token

We can now use the new access token in a request to the service provider.

In [ ]:"http://sp:8002/radiodns/tag/1/tag", {
  time_source: "user",
  bearer: "0.c221.ce15.ce1.dab",
  time: 1441792800
}, { form: true, token: "<access-token>" });

Viewing the tags

You can see the tags stored by the Service Provider here.