Authenticate
- Request a token from the authentication endpoint.
- Include the token in the Authorization header when making API calls.
For Autonomous AI Database Deployments
Use Bearer Authentication to access all endpoints.
To authenticate:
- Request a token by calling the
/broker/pdbcs/public/v1/tokenendpoint. - Use the obtained token as your Bearer token in the Authorization header:
Authorization: Bearer <your_token>Note:
When the token expires, you will receive a401response. To re-authenticate, userefresh_tokenin theAuthorizationheader.
Example using cURL: on Linux/Unix:
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"}'
Example using cURL on Windows:
Note that on Windows the command is curl.exe and that double quotes within the JSON data should be escaped.
curl.exe '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\"}'
For Marketplace Deployments
Use Basic Authentication to request a token. After you acquire the token, use Bearer Authentication to access all other endpoints.
To authenticate:
- Combine your username and password with a colon (:) in between. For example,
username:password. - Encode the resulting string in Base64 format. For example,
user123:pass456becomesdXNlcjEyMzpwYXNzNDU2. - Include the encoded string in the Authorization header of your request, prefixed with
Basic. For example:Authorization: Basic dXNlcjEyMzpwYXNzNDU2 - Request a token by calling
/dt-rest/v2/authentication/tokenendpoint using Basic Authentication. - Use the obtained token as your Bearer token in the Authorization header:
Authorization: Bearer <your_token>Note:
When the token expires, you'll receive a401response. To re-authenticate, userefresh_tokenin theAuthorizationheader.
Example using cURL:
curl 'http://<host_ip>:9999/dt-rest/v2/authentication/token -H 'Authorization: <base64_username:password>'