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

Integrate SAP BTP ABAP Environment and SAP S/4HANA Cloud, public edition using the OAuth 2.0 SAML Bearer Assertion Flow

Integrate SAP BTP, ABAP environment and SAP S/4HANA Cloud, public edition using the OAuth 2.0 SAML Bearer Assertion Flow. This tutorial takes an existing integration based on Basic Authentication and configures the more complex authentication mechanism to enable the usage of principal propagation.

Overview

🎓 intermediate 20 min. SAP BTP ABAP EnvironmentIntermediateABAP DevelopmentSAP S 4hana Cloud

You will learn

  • How to configure OAuth 2.0 for outbound connectivity.
  • How to configure an OAuth 2.0 Identity Provider for inbound connectivity.
Achim Seubert A Achim Seubert July 23, 2026
Created by November 27, 2024
Contributors

Prerequisites

Prerequisites

Steps

Intro

In this tutorial, all activities on S/4HANA Cloud side will be performed in the customizing tenant (100) of your development system.

Step 1 Understand the OAuth 2.0 SAML Bearer Assertion Flow

The OAuth 2.0 SAML Bearer Assertion flow works as follows:

At design time, the OAuth 2.0 client, in our case a system in the SAP BTP, ABAP environment, is signed up to the authorization server, in our case the SAP S/4HANA Cloud, public edition system. The authorization server provides the clients credentials.

At run time, the OAuth 2.0 client sends the following information to the token endpoint of the authorization server (1):

  • SAML Bearer Assertion (authorization grant)
  • Client ID
  • Client secret or client certificate

The authorization server authenticates the OAuth 2.0 client with its credentials (client id and client secret or client certificate), validates the SAML Bearer assertion, and, if the SAML Bearer assertion is validated successfully, the authorization server issues an access token (2).

The OAuth 2.0 client sends the access token to the resource server – in our case the SAP S/4HANA Cloud, public edition system – to access the protected resource (3). The protected resource validates the access token and, if valid, grants access.

OAuth explanation
OAuth explanation

The SAML Bearer Assertion is an XML document. It contains the information about the principal to be propagated. This information is stored in the &lt;saml.Subject&gt;<saml:NameID> element of the XML document. It provides the actual ID and its format.

To validate the SAML Bearer Assertion, the authorization server needs to trust the issuer of the SAML Bearer assertion – in our case, the system in the SAP BTP, ABAP Environment.

Step 2 Get OAuth 2.0 Endpoint Information
+
Step 3 Add OAuth 2.0 Client to Communication System in SAP BTP ABAP environment
+
Step 4 Modify Communication Arrangement in SAP BTP ABAP environment to use Authentication OAuth 2.0
+
Step 5 Obtain Signing Certificate
+
Step 6 Upload Signing Certificate in Communication System in SAP S/4HANA Cloud, public edition
+
Step 7 Modify Communication Arrangement in SAP S/4HANA Cloud, public edition to use Authentication OAuth 2.0
+
Step 8 Determine Business Catalogs for Service Authorization
+
Step 9 Execute Business Partner Service Call
+
Step 10 Verify Business Partner
+
Step 11 Test yourself
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 11
1. Understand the OAuth 2.0 SAML Bearer Assertion Flow 2. Get OAuth 2.0 Endpoint Information 3. Add OAuth 2.0 Client to Communication System in SAP BTP ABAP environment 4. Modify Communication Arrangement in SAP BTP ABAP environment to use Authentication OAuth 2.0 5. Obtain Signing Certificate 6. Upload Signing Certificate in Communication System in SAP S/4HANA Cloud, public edition 7. Modify Communication Arrangement in SAP S/4HANA Cloud, public edition to use Authentication OAuth 2.0 8. Determine Business Catalogs for Service Authorization 9. Execute Business Partner Service Call 10. Verify Business Partner 11. Test yourself

Learn more →