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.
- Connecting a technical user from the custom idP to the SAP cloud transport management destination
- Configuring OAuth2Password
- Troubleshooting common “unauthorized” errors in CTMS configuration
Step 1: Prepare the Technical User
- Org Manager (to create and manage spaces)
- Org User (basic org membership)
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
- URL in this format: https://deploy-service.cfapps.<default-domain>/slprot/<myspace-guid>/slp . For reference, see this SAP blog.
-
Use one of these formats: https://deploy-service.cfapps.<default-domain>/slprot/<my-space-guid>/slp OR https://deploy-service.cfapps.<default-domain>/slprot/<myorg>/<myspace>/slp
-
To find <my-space-guid>, Open the cloud foundry space → select a deployed app → check Environment Variables → search for “space_id” and copy the guid OR click on the cloud foundry space → look on the browser url tab and copy the guid after /space. reference the attached image
-
- Authentication: OAuth2Password
- Client ID: enter cf ( you can takea look at this documentation Creating Destinations with OAuth2Password Authentication )
- Client Secret : Password of technical user
- Password: Password of technical user
- Token Service URL: https://login.cf.us10.hana.ondemand.com . You can obtain this by replacing the “api” with “login” in your Cloud Foundry API endpoint. for example if the CF API Endpoint → https://api.cf.us10.hana.ondemand.com, Token Service URL → https://login.cf.us10.hana.ondemand.com
- Finally, add the origin property in the destination configuration, then click Create.
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
Other Helpful Links:
- Request for OAuth token failed – SAP BTP Destination
- How to specify user identity provider origin for BTP Destination
- Creating destinations with OAuth2Password authentication
- Common problems with Cloud Transport Management
- CTMS Setup for Build Work Zone objects
- Step By Step Configuring CTMS Setup in BTP
- Creating Destinations Using SAP Cloud Deployment Service with OAuth2Password Authentication.
Hopefully this helps someone out there.
Read More Technology Blog Posts by Members articles
#abap