SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Access Protected SAP Analytics Cloud Resources with OAuth Two-Legged Flow

Develop a sample client application that embeds an SAP Analytics Cloud story and configure the OAuth two-legged flow to provide access to the API.

Overview

🎓 intermediate 60 min. SAP Analytics CloudIntermediateCloudSapui5Security

You will learn

  • โœ”How to configure secure access to SAP Analytics Cloud resources with a two-legged OAuth flow
  • โœ”The roles involved in the two- and three-legged OAuth flows
Virat Tiwari V Virat Tiwari August 12, 2024
Created by September 27, 2018
Contributors

Prerequisites

Prerequisites

  • An administrator account on an SAP Analytics Cloud tenant
  • An administrator account in the SAP Cloud Identity Authentication service tenant
  • An administrator account on SAP Business Technology Platform

Steps

Intro

SAP Analytics Cloud (SAC) leverages the OAuth 2.0 framework to provide secure access to its resources exposed via REST APIs, for example, story APIs. SAC provides support for both two-legged and three-legged OAuth flows.

Both flows involve the following roles:

  • Resource Owner: User

    The resource owner is the user who authorizes an application to access his or her account. The application’s access to the user account is limited to the “scope” of the authorization granted – for example, read or write access.

  • Client: Application

    The client is the application that wants to access the user account. Before it can do so, the user must authorize the access, and the API must validate the authorization.

  • Resource / Authorization Server: API

    The resource server hosts the protected user accounts. The authorization server verifies the identity of the user and, then, issues access tokens to the application.

Step 1 Three-Legged versus Two-Legged OAuth 2.0 Flows####
โ€”

In the three-legged flow, all three roles are actively involved. For example, the user must explicitly authorize the client application to access the resources that the user owns.

In the two-legged flow, on the other hand, the user is not actively involved. Instead, the SAML bearer assertion token obtained during the login to the client application is exchanged with the SAP Analytic Cloud OAuth token behind the scenes.

An important factor to consider when you choose between the three-legged and two-legged flows is the customer landscape. Typically, you find a central IDP in an enterprise landscape. The purpose of a central IDP within an enterprise is to manage Identity federation and provide an SSO experience to end users across different applications. With this landscape, you should implement the two-legged flow to ensure a seamless OEM experience.

Step 2 Overview of the Two-Legged Flow####
+
Step 3 Create a web application
+
Step 4 Fetch the SAML bearer assertion token
+
Step 5 Exchange the assertion token with the OAuth token
+
Step 6 Create a new OAuth Client with a Grant Type
+
Step 7 Maintain the Trusted Identity Provider for the SAML Bearer Assertion###
+
Step 8 Create a new connectivity destination in SAP Business Technology Platform
+
Step 9 Verify Results
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Three-Legged versus Two-Legged OAuth 2.0 Flows#### 2. Overview of the Two-Legged Flow#### 3. Create a web application 4. Fetch the SAML bearer assertion token 5. Exchange the assertion token with the OAuth token 6. Create a new OAuth Client with a Grant Type 7. Maintain the Trusted Identity Provider for the SAML Bearer Assertion### 8. Create a new connectivity destination in SAP Business Technology Platform 9. Verify Results

Learn more →