Authenticate
Authentication and authorization in Oracle Analytics Cloud is managed by Oracle Identity Cloud Service (IDCS). To access the Oracle Analytics Cloud REST APIs, you need an OAuth 2.0 access token to use for authorization.
OAuth 2.0 Token Authentication
This authentication type requires a bearer token, obtained by an initial call to the Oracle Identity Cloud Service token REST API (oauth2/v1/token) with suitable parameters. For more information on how to obtain tokens and the options available for grant types, see Managing Authorization Using the API.
Note:
You must obtain the token with a user context. This means you can't use some grant types, such as the Client Credentials grant type, to access Oracle Analytics Cloud REST APIs.Use the Token to Call the Oracle Analytics Cloud REST API
When you have a bearer token, use the token to call the Oracle Analytics Cloud REST API.
For example, you can create the file token.txt
that holds your access token, in
the format:
Authorization: Bearer <access token>
You can then use the following curl command to use that token:
curl -i \
--header @token.txt \
--request GET 'https://<my-oac-instance>.analytics.ocp.oraclecloud.com/api/20210901/snapshots'
The benefit of using a file is that your token is not exposed in the command line history. It's also important to ensure that the file permissions are set so only the user who owns the token has access.