In [ ]:
require('/opt/notebooks/tutorial/lib/tutorial-utils')(this);
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 "http://tech.ebu.ch/cpa/1.0/client_credentials"
.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 [ ]:
this.post("http://ap:8001/token", {
grant_type: "http://tech.ebu.ch/cpa/1.0/client_credentials",
client_id: "<client_id>",
client_secret: "<client_secret>",
domain: "sp:8002"
});
In [ ]:
this.post("http://sp:8002/radiodns/tag/1/tag", {
time_source: "user",
bearer: "0.c221.ce15.ce1.dab",
time: 1441792800
}, { form: true, token: "<access-token>" });
You can see the tags stored by the Service Provider here.