This instalment belongs to a mini series of blogs on SAP Analytics Cloud App Integration with OAuth2SAMLBearerAssertion flow. The SAML 2.0 Bearer Assertion Flow typically comes into play when we want to give a client application's users an automated access to remote resources or assets which are protected with the OAuth2.0 protocol. A common assumption is that the user's remote resource access scope will be determined by the user's identity as it is known on the client application side. Thus the most important aspect of this flow is the propagation of the user's identity to the backend system commonly referred to as Principal (=user identity) Propagation And this is where the SAP BTP Destination service comes to the rescue. Good to know:
|
Assuming you have the right level of access to your target SAC system you may need to create your own OAuth2.0 client application. Your SAC system maybe either Enterprise or Embedded Edition tenant on SAP BTP Cloud Foundry. Before you can configure the API hub sandbox environment you will need to have created an instance of the destination service. Please refer to the following article on the details for the sandbox environment configuration with SAP API Business Hub. Let's call the OAuth client Quovadis-SAC. (But this can be any name.) The OAuth client should be for the interactive usage and there is no need to define any redirect uri. With the saml bearer assertion flow (as apposed to the authorization code flow) there will be no refresh token. We shall only be retrieving a short lived access token. |
Assuming you will be rehearsing the access to the destination
service APIs with the SAP Business API Hub sandbox environment
you do not need to write a single line of code.
All you need to do is create a definition of your destination
Your destination will be called by the destination
service find api any time you need to procure a bearer access token
to authorize access to remote resource.
Post (=create) a new destination:
Put (=update) an existing destination:
https://destination-configuration.cfapps.<region>.hana.ondemand.com/destination-configuration/v1/sub...
{
"Name": "Quovadis-SAC",
"Type": "HTTP",
"URL": "<SAC tenant URL>",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "<OAuth2SAML Audience from SAC/System/Administration/App Integration>",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:PreviousSession",
"clientKey": "<client_id from your SAC OAuth2 client>",
"tokenServiceUser": "<client_id from your SAC OAuth2 client>",
"SystemUser": "<technical user email address>",
"tokenServiceURL": "<OAuth2SAML Token URL from SAC/System/Administration/App Integration>",
"tokenServicePassword": "<client_secret from your SAC OAuth2 client>"
}
Most of the values in the above destination defintion:
{
"URL": "<SAC tenant URL>",
"audience": "<OAuth2SAML Audience from SAC/System/Administration/App Integration>",
"clientKey": "<client_id from your SAC OAuth2 client>",
"tokenServiceUser": "<client_id from your SAC OAuth2 client>",
"SystemUser": "<technical user email address>",
"tokenServiceURL": "<OAuth2SAML Token URL from SAC/System/Administration/App Integration>",
"tokenServicePassword": "<client_secret from your SAC OAuth2 client>"
}
will have come from the SAC/CF OAUTH2.0 service endpoints
exposed in SAC/System/Administration/App Integration of your
SAC CF tenant.
The destination service will eventually call the tokenServiceURL on your behalf
to get you the bearer access token (a jwt token) which in turn you can use with
SAP Analytics Cloud APIs to gain access to SAC tenant assets and resources
For the sake of simplicity let's use a technical user, a user
that must exist in both the client application and the target
backend system.
In a productive scenario you would rather be using
a user JWT token instead!
Find destination API call:
https://destination-configuration.cfapps.<region>.hana.ondemand.com/
destination-configuration/v1/destinations/Quovadis-SAC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
34 | |
13 | |
11 | |
11 | |
10 | |
9 | |
9 | |
9 | |
8 | |
7 |