S/4HANA Cloud Product Master APIs with OAuth2SAMLBearerAssertion.SAP Extensibility Explorer for SAP S/4HANA Cloud |
I previously shared how to implement either ODATA v2 or ODATA v4 APIs from SAP_COM_0009 scenario with SAP API Management, part of SAP Integration Suite bundle. Let me describe how to do it with SAP BTP destinations. Pre-requisites:
Disclaimer:
|
![]() | ![]() |
OAuth 2.0 is a widely-adopted security protocol for protection of resources over the Internet. It allows an application to request authentication on behalf of users with third-party user accounts, without the user having to grant its credentials to the application. You can set up inbound OData interface API_PRODUCT_SRV, API_PROD_HIER_NODES_SRV, API_PROD_HIER_PRODS_SRV, API_PRODUCTTYPE, API_PRODUCTGROUP_2 with OAuth 2.0 authentication.
| COMM_0009 inbound API | ODATA version | ODATA interface (Service Group Name) | supported user identity with OAuth2SAMLBearerAssertion flow |
| 1. Product Master (A2X) | v2 | API_PRODUCT_SRV | business user or communication user |
| 2. Product Type | v4 | API_PRODUCTTYPE | communication user only |
| 3. Product Group Data | v4 | API_PRODUCTGROUP_2 | communication user only |
{
"owner": {
"SubaccountId": "<SubaccountId>",
"InstanceId": null
},
"destinationConfiguration": {
"Name": "S4HC-ProductMaster",
"Type": "HTTP",
"URL": "https://my30xxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/API_PRODUCT_SRV",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "https://my30xxxx.s4hana.ondemand.com",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:x509",
"Description": "https://api.sap.com/api/API_PRODUCT_SRV/overview",
"tokenServiceUser": "<CommunicationUser>",
"tokenServiceURL": "https://my30xxxx-api.s4hana.ondemand.com/sap/bc/sec/oauth2/token",
"tokenServicePassword": "<CommunicationUserPassword>",
"clientKey": "<CommunicationUser>",
"nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"scope": "API_PRODUCT_SRV_0001",
"SystemUser": "<business user email address>"
},
"authTokens": [
{
"type": "Bearer",
"value": "-hY-fl00HuyJ7h9my7nb2ySsRcuwuWJ4YdcjDK24gAxxxxxx",
"http_header": {
"key": "Authorization",
"value": "Bearer -hY-fl00HuyJ7h9my7nb2ySsRcuwuWJ4YdcjDK24gAxxxxxx"
},
"expires_in": "3600",
"scope": "API_PRODUCT_SRV_0001"
}
]
}| Consuming the ODATA endpoint from a 3rd party application (Postman) | ![]() |
ProductType is an ODATAv4 API. It does support the user identity propagation with OAuth2SAMLBearerAssertion flow but only with the communication (technical) user. The reason behind it is that currently there is no way to assign the relevant scope to the business user. |
{
"owner": {
"SubaccountId": "afbac4de-9d13-4ef5-b480-f1d80ccb9ad4",
"InstanceId": null
},
"destinationConfiguration": {
"Name": "S4HC-ProductType",
"Type": "HTTP",
"URL": "https://my30xxxx-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_producttype/srvd_a2x/sap/producttype/0001/",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "https://my30xxxx.s4hana.ondemand.com",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:x509",
"Description": "https://api.sap.com/api/PRODUCTTYPE_0001/overview",
"tokenServiceUser": "<CommunicationUser>",
"tokenServiceURL": "https://my30xxxx-api.s4hana.ondemand.com/sap/bc/sec/oauth2/token",
"tokenServicePassword": "<CommunicationUserPassword>",
"clientKey": "<CommunicationUser>",
"nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
"scope": "API_PRODUCT_SRV_0001 OV4:API_PRODUCTGROUP_2 OV4:API_PRODUCTTYPE",
"SystemUser": "<CommunicationUser>"
},
"authTokens": [
{
"type": "Bearer",
"value": "-hY-fl00HtyJ8Mf06r0Bc7n14UhL3vLHwO-Vx1IJvQxxxxxx",
"http_header": {
"key": "Authorization",
"value": "Bearer -hY-fl00HtyJ8Mf06r0Bc7n14UhL3vLHwO-Vx1IJvQxxxxxx"
},
"expires_in": "3600",
"scope": "API_PRODUCT_SRV_0001 OV4:API_PRODUCTGROUP_2 OV4:API_PRODUCTTYPE"
}
]
}| Consuming the ProductType endpoint from a 3rd party application (Postman) | ![]() |
{
"owner": {
"SubaccountId": "<SubaccountId>",
"InstanceId": null
},
"destinationConfiguration": {
"Name": "S4HC-ProductGroupData",
"Type": "HTTP",
"URL": "https://my30xxxx-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_productgroup_2/srvd_a2x/sap/productgroup/0001",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "https://my30xxxx.s4hana.ondemand.com",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:x509",
"Description": "https://api.sap.com/api/PRODUCTGROUP_0001/overview",
"tokenServiceUser": "<CommunicationUser>",
"tokenServiceURL": "https://my30xxxx-api.s4hana.ondemand.com/sap/bc/sec/oauth2/token",
"tokenServicePassword": "<CommunicationUserPassword>",
"clientKey": "<CommunicationUser>",
"nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
"scope": "API_PRODUCT_SRV_0001 OV4:API_PRODUCTGROUP_2 OV4:API_PRODUCTTYPE",
"SystemUser": "<CommunicationUser>"
},
"authTokens": [
{
"type": "Bearer",
"value": "-hY-fl00HtyJ8ImbinzA5ggEtf7TwlLH-fGlKFUCeAxxxxxx",
"http_header": {
"key": "Authorization",
"value": "Bearer -hY-fl00HtyJ8ImbinzA5ggEtf7TwlLH-fGlKFUCeAxxxxxx"
},
"expires_in": "3600",
"scope": "API_PRODUCT_SRV_0001 OV4:API_PRODUCTGROUP_2 OV4:API_PRODUCTTYPE"
}
]
}| Consuming the ProductGroup endpoint from a 3rd party application (Postman) | ![]() |
![]() | The ProductMaster ODATAv2 API_PRODUCT_SRV supports a business user identity propagation as the OAuth scope can be granted to the business user via the SAP_CMD_BC_PR_MAINT_PC business catalog. On the other hand, as aforementioned, currently there is no way to assign the OAuth scope to a business user for either of the ODATAv4 inbound APIs. Which translates these APIs only support communication user identity propagation with the OAuth2SAMLBearerAssertion flow. |
![]() | If this user identity propagation asymmetry were an issue at all, please note all these APIs support the x509 client certificate authentication method as well, which overall is a good alternative when the communication user is to be used (by design the x509 client certificate uniquely designates a given communication user). |


// destinationConfiguration template with SystemUser as username
//
{
"Name": "<Name>",
"Type": "HTTP",
"URL": "https://my30xxxx-api.s4hana.ondemand.com/sap/opu/<ODATA API suffix>",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "https://my30xxxx.s4hana.ondemand.com",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:x509",
"Description": "Description",
"tokenServiceUser": "<CommunicationUser>",
"tokenServiceURL": "https://my30xxxx-api.s4hana.ondemand.com/sap/bc/sec/oauth2/token",
"tokenServicePassword": "<CommunicationUserPassword>",
"clientKey": "<CommunicationUser>",
"nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
"scope": "<scope list>",
"SystemUser": "<CommunicationUser>"
}// destinationConfiguration template with SystemUser as email address
//
{
"Name": "<Name>",
"Type": "HTTP",
"URL": "https://my30xxxx-api.s4hana.ondemand.com/sap/opu/<ODATA API suffix>",
"Authentication": "OAuth2SAMLBearerAssertion",
"ProxyType": "Internet",
"tokenServiceURLType": "Dedicated",
"audience": "https://my30xxxx.s4hana.ondemand.com",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:x509",
"Description": "Description",
"tokenServiceUser": "<CommunicationUser>",
"tokenServiceURL": "https://my30xxxx-api.s4hana.ondemand.com/sap/bc/sec/oauth2/token",
"tokenServicePassword": "<CommunicationUserPassword>",
"clientKey": "<CommunicationUser>",
"nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"scope": "<scope list>",
"SystemUser": "<business user email address>"
}




Product Master (A2X) - https://api.sap.com/api/API_PRODUCT_SRV/overview Product Type - https://api.sap.com/api/PRODUCTTYPE_0001/overview Product Group Data - https://api.sap.com/api/PRODUCTGROUP_0001/overview __________ |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 10 | |
| 9 | |
| 6 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |