Authenticate

You can access Data Transforms REST resources over HTTPS. To authenticate you will need to do the following:
  • Request a token from the authentication endpoint.
  • Include the token in the Authorization header when making API calls.

For Marketplace Deployments

Use Basic Authentication (BasicAuth (http, Basic)) to request a token. After you acquire the token, use Bearer Authentication (BearerAuth (http, Bearer)) to access all other endpoints.

To authenticate:

  1. Combine your username and password with a colon (:) in between. For example, username:password.
  2. Encode the resulting string in Base64 format. For example, user123:pass456 becomes dXNlcjEyMzpwYXNzNDU2.
  3. Include the encoded string in the Authorization header of your request, prefixed with Basic. For example:

    Authorization: Basic dXNlcjEyMzpwYXNzNDU2

  4. Request a token by calling /dt-rest/v2/authentication/token endpoint using Basic Authentication.
  5. Use the obtained token as your Bearer token in the Authorization header:

    Authorization: Bearer <your_token>

    Note:

    When the token expires, you'll receive a 401 response. To re-authenticate, use refresh_token in the Authorization header.

Example using cURL:

curl 'http://<host_ip>:9999/dt-rest/v2/authentication/token -H 'Authorization: <base64_username:password>'

For Autonomous AI Database Deployments

Use Bearer Authentication (BearerAuth (http, Bearer)) to access all endpoints.

To authenticate:

  1. Request a token by calling the /broker/pdbcs/public/v1/token endpoint.
  2. Use the obtained token as your Bearer token in the Authorization header:

    Authorization: Bearer <your_token>

    Note:

    When the token expires, you will receive a 401 response. To re-authenticate, use refresh_token in the Authorization header.

Example using cURL:

curl 'https://<host> /odi/broker/pdbcs/public/v1/token' -H 'Content-Type: application/json' -d '{"username":"<username>","password":"<password>","tenant_name":"<tenant OCID>","database_name":"<database name>","cloud_database_name":"<database OCID>","grant_type":"password"}'