How Does Primavera Cloud Support Basic Authentication?

To access the Oracle Primavera Cloud REST API hosted on Oracle Cloud Infrastructure (OCI), you need to generate an Basic token using Basic Authentication. This token will then be used to authenticate your API requests. Oracle Primavera Cloud uses OAuth based Bearer authentication scheme.

Generate OAuth Token Using Basic Authentication

Use the primediscovery endpoint to generate an OAuth access token. This endpoint requires Basic Authentication with a valid user and password. The scope should be the full path (always http) to the application's context root- http://<SERVER_URL>/api.

To Generate the OAuth Token:

Step 1: Encode Credentials in Base64

Generate the Base64 encoded value of your email and password. In a Linux environment, you can use the following command:

echo -n <user_email>:<password> | base64

Step 2: Request for the OAuth Token Using Curl or a REST Client

Use encoded credentials to request the OAuth token using CURL or a REST Client (such as Postman). Replace <SERVER_URL> with the URL of the server to which your application is deployed and <Base64-Encoded-value-of-user-password> with Base64 encoded credentials <user_email>:<password>.

  • Using CURL:
curl -X POST "https://<SERVER_URL>/primediscovery/apitoken/request?scope=http://<SERVER_URL>/api" \
 -H "Authorization: Basic <Base64-Encoded-value-of-user-password>" \

  • Using a REST Client:
POST https://<SERVER_URL>/primediscovery/apitoken/request?scope=http://<SERVER_URL>/api

Enter the following information in Headers:

Authorization: Basic < Base64 Encoded user:password>

Step 3: Interpret the Response

The response will contain the OAuth access token and additional details.

Response Payload

{
    "accessToken": "<OAuth-Access-Token>", //deprecated
    "access_token": "<OAuth-Access-Token>",
    "token_type": "Bearer",
    "primeTenant": "<tenant>",
    "primeTenantCode": "<tenant-code>",
    "userName": "<identity_domain_user_email>", //deprecated
    "username": "<identity_domain_user_email>"
    "userId": "<identity_domain_user_guid>",
    "primeIdentityApp": "<prime_app_identity_id>",
    "expiresIn": 3600 //deprecated
    "expires_in": 3600
    "requestHeaders": {
        "<x-param1>": "<param1-value>",
        "<x-param2>": "<param2-value>",
                    ...
                    ...
                    ...
        "<x-paramN>": "<paramN-value>"
    }

Note: The following fields have been deprecated: accessToken, UserName, expiresIn. Use the following fields instead: access_token, username, expires_in.

Use the OAuth Token to Access the API

After obtaining the OAuth token, use it to authenticate your requests to the Primavera Cloud REST API. Include the token and any required headers in your requests. Copy the requestHeaders from the response in your code. See Use OAuth Token for HTTP Authentication for more information.