How Does Primavera Cloud Data Service Support Basic Authentication?

To access the Oracle Primavera Cloud Data Service hosted on Oracle Cloud Infrastructure (OCI), you need to generate a Basic access token using Basic Authentication. This token will then be used to authenticate your data service requests. Oracle Primavera Cloud Data Service 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 must be the full path (always http) to the application's context root, for example: http://<SERVER_URL>/data.

To Generate the OAuth Token:

Step 1: Encode Credentials in Base64

You need to generate a Base64 encoded version of your user name (email) and password.

To generate an encoded version of your Oracle Primavera Cloud user name and password:

  1. Go to https://www.base64encode.org/.
  2. Enter the user name and password in the following format: username:password
  3. Click Encode.
  4. Copy the encoded user name and password.
  5. Replace <Base64-encoded-username-and-password> in the example in step 2 with the encoded user name (email) and password.

Step 2: Request for the OAuth Token Using curl

Use encoded credentials to request the OAuth token using curl:

curl -X POST "https://<SERVER_URL>/primediscovery/apitoken/request?scope=http://<SERVER_URL>/data" \
 -H "Authorization: Basic <Base64-encoded-username-and-password>"

Where:

  • <SERVER_URL> is the URL of the server to which your application is deployed
  • <Base64-encoded-username-and-password> is the Base64 encoded version of your Primavera Cloud user name (email) and 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 Data Service. Include the token and any required headers in your requests. Copy the requestHeaders from the response in your code. See Use OAuth Token for HTTPS Authentication for more information.