Tags: V1 APIs
, Sandbox
, Bearer Token
Platform of Trust authentication supports OAuth 2.0 protocol for authorization. Thus in order to perform most of requests to Platform Of Trust APIs, users must be authorized.
This guide is meant for everyone who wants to use or simply try out Platform Of Trust capabilities. As user or identity authorization is an essential part of it.
Note: Keep in mind, that version 1 APIs in Platform of Trust have been used in this demonstration.
A signed JWT token. Platform of Trust can validate it and communicate with any party who is able to provide such token.
Bearer token
In encoded form, it looks like eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf
, as you might have seen in many examples and guides. A bearer token is easy to decode and no information is hidden, because the purpose of bearer token is to pass information with signed by signature. When signature is validated, the data can be trusted. If you want to decode token you can do it online.
NOTE: Bearer token gets expired after 24 hours.
There is only one possibility to obtain Bearer token is being authorized via an application such as the World application.
To get the bearer token:
Sandbox
, open the developer tool in your browser.Authorization
cookie appearing. This cookie contains the Bearer token
.NOTE:
Make sure to remember getting the regenerated token after
24 hours
to continue using it in the workspace.
curl --request POST \
--url https://api-sandbox.oftrust.net/apps/v1 \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf' \
--header 'Content-type: application/json' \
--data '{
"name": "Example Application",
"description": "Application description",
"privacyPolicyUrl": "http://example.com/privacy.html",
"webPageUrl": "http://example.com/application.html",
"iconUrl": "http://example.com/icon.png",
"scopes": "",
"defaultScopes": "",
"redirectUris": "https://example.com/auth-callback",
"defaultRedirectUri": "https://example.com/auth-callback",
"groupId": "7a5c0197-7e05-4180-8d6f-104911880eee"
}'
To know which API request requires Authorization
header, check API documentation
Bearer token is required for most of the requests in Platform of Trust. It enables an extra security level that ensures the validity and consistency of data that the platform helps to provide.
The recommended next step is to register a new app.
The open sandbox is your friend! It's an isolated environment for testing applications and data product integrations. Read more from the Sandbox guide.