Setting Up Authentication
You must set up authentication before you can use the SAP Analytics Cloud REST APIs.
The following options are supported for authenticating against the OAuth service:
|
Authentication Method |
Description |
|---|---|
|
Configuring OAuth 2.0 SAML Bearer Assertion Workflow (2-legged OAuth) |
For when your application is deployed on a SAP Business Technology Platform (SAP BTP) server and uses the SAP BTP SDK.
|
|
Configuring OAuth 2.0 Client Credentials Grant workflow (2-legged OAuth) |
For non-browser based application access to the REST API technical user. |
|
Configuring OAuth 2.0 Authorization Code Grant workflow (3-legged OAuth) |
For non-browser based application access to the REST API. |
|
Basic Authentication Against the Token Service |
The simplest option for getting started for development and automation purposes. Recommended for use with the api/v1/scim endpoint. You must create an OAuth client in your SAP Analytics Cloud tenant. Your application will then be able to authenticate against the system’s OAuth service and obtain authorization to authenticate against the API. |
Configuring OAuth 2.0 SAML Bearer Assertion Workflow (2-legged OAuth)
The OAuth 2.0 SAML Bearer Assertion workflow, is supported for server access to the REST API when your application is deployed on a SAP Business Technology Platform (SAP BTP) server and uses the SAP BTP SDK.
The SAP BTP provides an OAuth2SAMLBearerAssertion destination feature which takes care of the OAuth workflow for you.
Prerequisites
-
SAP Analytics Cloud tenant.
-
An administrator account on an SAP Analytics Cloud tenant.
-
A SAP BTP account for deploying the application used to access the API.
-
Java application to access the API using the SAP BTP SDK.
-
The SAP BTP account hosting the Java application must be configured to use the same IdP as the tenant.
-
You must have a signing certificate for the local service provider for the SAP BTP account hosting the Java application.
Tenant Configuration
-
OAuth Client
-
Trusted Identity Provider
-
Name
-
OAuth Client ID
-
Authorization Grant
-
Confidential
-
Secret
If the SAP BTP account where your Java application is deployed is not configured to use the same IdP as the SAP Analytics Cloud tenant, see Configure Trust to the SAML Identity Provider Providers.
The signing certificate from the SAP BTP account where your Java application is deployed must be saved on the tenant as a Trusted Identity Provider. The signing certificate can be found in the SAP BTP account in the following location: .
The Local Provider Settings should be set as follows: Configuration Type should be set to Custom, Principle Propagation must be set to Enabled, and Generate Key Pair if Required must be selected. For additional details, see Configure SAP Business Technology Platform as a Local Service Provider Providers. Copy the produced Signing Certificate and save it as a Trusted Identity provider on the tenant. For more information, see Managing OAuth Clients and Trusted Identity Providers.
Application Configuration
-
Deploy your application to your SAP BTP account.
-
Configure a destination with the Authentication Type OAuth2SAMLBearerAssertion in the SAP BTP account to connect your application to the API end point.
-
Audience
-
Client Key
-
Token Service
-
Token Service User
-
Token Service Password
The Audience field should be set to the URL of the tenant being accessed. Token Service should be set to the Token URL that is listed on the SAP Analytics Cloud page. The Client Key and Token Service User use the Client ID set in the OAuth Client saved on your SAP Analytics Cloud tenant. The Token Service Password is the Secret saved in the SAP Analytics Cloud tenant.
Once the tenant is configured and the destination in the SAP BTP account is configured, your application may attempt to complete the workflow. We recommend using the SAP BTP SDK to access the destination from within your application as it simplifies the OAuth workflow. For more information on how to use the SAP BTP SDK to access destinations, see these Tutorials.
Configuring OAuth 2.0 Authorization Code Grant Workflow (3-legged OAuth)
The OAuth 2.0 Authorization Code Grant workflow, is supported in SAP Analytics Cloud for non-browser based application access to the REST API.
As part of the OAuth 2.0 Authorization Code Grant workflow, the application consuming the SAP Analytics Cloud endpoint must obtain an authorization token from the SAP Analytics Cloud tenant in order to access resources.
Prerequisites
-
SAP Analytics Cloud tenant.
-
An administrator account on the SAP Analytics Cloud tenant.
-
A non-browser based application used to access the REST API.
Tenant Configuration
To establish a connection, an OAuth Client must be registered on your SAP Analytics Cloud tenant. For information on registering an OAuth client, see Managing OAuth Clients and Trusted Identity Providers.
-
Name
-
OAuth Client ID
-
Authorization Grant - The type must be set to Authorization Code
-
Confidential
-
Secret
Once the OAuth Client is registered on your SAP Analytics Cloud tenant, your application may attempt to complete the OAuth workflow to access the API resources. You will need the OAuth Client ID and Secret, to configure your application.
Application Configuration
The application will need to obtain an Access Token from the SAP Analytics Cloud tenant in order to access the API resources for a user. The Token URL and Authorization URL are required to complete the workflow. The URLs are listed on the SAP Analytics Cloud page.
-
Request Authorization Code.
-
This must be done through the tenant Authorization URL.
-
The user must enter their SAP Analytics Cloud tenant credentials when redirected to the tenant IdP.
-
Access to the requested resources must be authorized by the user when prompted.
-
-
Request Access Token.
-
This must be done via the tenant Token URL.
-
The Authorization Code from step 1 is required.
-
The OAuth Client ID and Secret and must be provided as part of the request.
-
-
If OAuth authorization is successful, the returned token can be used to access the API.
Basic Authentication Against the Token Service
You must create an OAuth client in your SAP Analytics Cloud tenant. Your application will then be able to authenticate against the system’s OAuth service and obtain authorization to authenticate against the API.
Prerequisites
An OAuth client for your application must be created in SAP Analytics Cloud. For more information, see Managing OAuth Clients and Trusted Identity Providers.
Context
The exact mechanism for authenticating against the token service will depend upon the programming language you are using and whether you are using a framework for managing OAuth requests. In general, you must do the following:

