Use OAuth Token for HTTPS Authentication
The Oracle Primavera Cloud Data Service uses HTTPS token authentication to authenticate requests. To authenticate, clients must provide the token generated by a valid Primavera Cloud user or an authorization server in the HTTPS headers of their requests. Various tools and programming languages, such as curl and Java, offer mechanisms to facilitate HTTPS token authentication.
Depending on the authentication type you are using, see the How Does Primavera Cloud Data Service Support OAuth 2.0? or How Does Primavera Cloud Support Basic Authentication? sections to learn how to generate an OAuth token to access the data service.
Authentication Using curl
To authenticate using curl, include the OAuth token generated through Basic Authentication or an authorization server in your request headers.
curl -X GET https://<SERVER_URL>/data/rest/dataservice -H "Authorization: Bearer <OAuth-Access-Token>" -H "Content-Type: application/json" -H "x-prime-tenant-code: <tenant-code>"
Where:
-
<SERVER_URL>is the server URL where the application is deployed (For example, primavera.oraclecloud.com). -
<OAuth-Access-Token>is the OAuth token generated using Basic Authentication or an authorization server. -
<tenant-code>is the Primavera Cloud tenant where the data exists.
Note:
You can obtain the values for<OAuth-Access-Token> and
<tenant-code> from the OAuth token generation response. For more information, see
How Does Primavera Cloud Support Basic Authentication?.
Sample curl Request Using OAuth Token
Construct the curl request with the OAuth token and additional headers as follows :
curl -X GET https://<SERVER_URL>/data/rest/dataservice -H "Authorization: Bearer <OAuth-Access-Token>" -H "Content-Type: application/json" -H "x-prime-tenant-code: <tenant-code>"