Authenticate
- 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:
- 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>'
For Autonomous AI Database Deployments
Use Bearer Authentication (BearerAuth (http, Bearer)) 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:
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"}'