The Postman request:
Standard headers, nothing to update here.
Values that are used for this demo:
| Key | Value | Notes |
|---|---|---|
| grant_type | client_credentials | |
| scope | das-api/office-exchange | type of access to give to the user |
| client_assertion_type | urn:ietf:params:oauth:client-assertion-type:jwt-bearer | standard jwt bearer authentication |
| client_assertion | {{client-assertion}} | value to be retrieved from the Postman environment. Before executing this request, please generate your assertion as per indicated in these pages: d.3.- Executing the sample scripts under linux or d.4.- Executing the sample scripts via docker. Then update the Postman environment with the obtained JWT assertion |
Nothing here.
The following script is executed after the request is sent, to evaluate the response and also to set up environment variables (if they are needed for following requests)
// following test will verify the expected response code for this request
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
// tests validate the reception of the access code from das
pm.test("Received ACCESS-TOKEN for DAS access", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.access_token).not.eql(undefined);
if (jsonData.access_token !== undefined) {
console.log("access-token received:"+jsonData.access_token)
//the new access token is saved in the postman environment for use in the other requests.
pm.environment.set("access-token", jsonData.access_token);
}
});
|
In this case the body will mainly show the access token provided y the time left for its use.
Normal headers.
This depends on the test we set up in the test script