SAP CTMS: Destination Configuration with SAP IAS and OAuth2Password
Share

Configuring Destinations for SAP Transport Management with a Custom Identity Provider

If you’ve ever set up SAP Transport Management destinations with a P-user or S-user authenticated via the SAP default identity service (origin key: sap.default, value: sap.ids), you know the configuration is usually straightforward.

But what happens when you need to set up an automated process using a technical user from a custom identity provider? Suddenly, you’re faced with OAuth2Password flows, origin parameters, and authentication challenges that can leave even experienced developers scratching their heads.

In this post, I’ll walk you through the common pitfalls and provide a straight forward solutions for:
  • Connecting a technical user from the custom idP to the SAP cloud transport management destination
  • Configuring OAuth2Password 
  • Troubleshooting common “unauthorized” errors in CTMS configuration
Whether you’re using Microsoft Entra ID (formerly Azure AD), ADFS, or another enterprise IdP, this guide will help you bridge the gap between basic authentication with SAP’s default IdP to OAuth2Password authentication with custom IdPs.

Step 1: Prepare the Technical User

First, ensure your technical user is properly configured in your custom identity provider (e.g., SAP Identity Authentication Service, Azure AD, etc.) with both a username AND password. Unlike personal users who might use SSO flows, technical users for automation require explicit username and password credentials.
Next, in your BTP Subaccount, assign the technical user the necessary Cloud Foundry roles:
  • Org Manager (to create and manage spaces)
  • Org User (basic org membership)
Note: These roles must be assigned through your custom IdP’s user management on the BTP Cockpit, not the default SAP ID Service.
if the SAP IAS to custom identity federation has not been configured yet, these articles are worth looking at SSO with MS Entra ID and SAP IAS and SAP Cloud IAS for Beginners 

Step 2: Authenticate via CLI

Following the official SAP documentation sap documentation. Run the following commands:

cf api https://api.cf.<region>.hana.ondemand.com

 

cf login –origin <origin> -u <user> -p <password>

Example:  cf login –origin abc-origin -u johndoe@gmail.com -p 123456

  • How to find <origin>  
    • Go to your Subaccount in the cockpit.
    • Navigate to Cloud Foundry → Org Members.
    • Look for the origin value in the user table.

N/B: origin is usually configured during the SAP IAS → Custom IdP federation setup

  • If you are able to log in successfully via CLI, you’re Two steps closer.

Step 3: Configure the Destination

UNAUTHORIZED ERROR:

To troubleshoot the unauthorised error

Solution 1:  When using a technical user, ensure that the Authentication type configured for the destination is of type “OAuth2Password”

Solution 2: Ensure that the additional property is configured for this destination where the origin value for the custom idP is added. 

Solution 3:  Ensure the client ID, client secret and password are correctly configured

 

FORBIDDEN ERROR:

When troubleshooting for the “forbidden” error when using the CTMS to transport MTA applications, ensure that the technical user has the following roles: org User, SpaceDeveloper. Additional links for trouble shooting the “forbidden” error  . Troubleshooting Issues when Transporting Multitarget Applications

Screenshot 2025-08-30 at 18.07.49.png

Other Helpful Links: 

Hopefully this helps someone out there. 

 

  Read More Technology Blog Posts by Members articles 

#abap

By ali