Home / SAP Joule Guide / Building Agents

Joule Agent Authentication: BTP Destinations & SSO Setup

Set up IAS, BTP destinations and principal propagation so your Joule agents call S/4HANA with each user’s own authorizations.

Building Agents9 min readUpdated Dec 2026
TL;DR
  • Use a technical user only for demos or read-only, non-personal data. For real agents, use user propagation, so S/4HANA applies each user’s own roles.
  • On-premise and Private Cloud: Cloud Connector + principal propagation. S/4HANA Cloud Public Edition: OAuth 2.0 SAML Bearer through a communication arrangement.
  • Trust has to line up end to end: IAS ↔ BTP subaccount ↔ S/4HANA. Most failures come from a missing link in that chain.

Authentication is where most first Joule agents get stuck. The agent works in testing with your user, then fails or, worse, over-shares in production. This guide explains the options and the setup we use for S/4HANA.

Basic auth vs principal propagation

ApproachWho S/4HANA seesUse for
Basic auth / technical userOne shared system userProofs of concept, non-sensitive read-only data
Principal propagation (on-prem / Private Cloud)The real end userProduction agents on S/4HANA on-prem or Private Cloud
OAuth 2.0 SAML Bearer (Public Cloud)The real end userProduction agents on S/4HANA Cloud Public Edition
Why it matters: with a technical user, an agent can show any user data that the technical user can see. With user propagation, the agent can never show more than the person asking is allowed to see.

Set up trust with SAP Cloud Identity (IAS)

  1. Connect the BTP subaccount to IASSet up trust between your subaccount and your SAP Cloud Identity Services tenant, so users sign in with corporate identities.
  2. Map role collectionsAssign SAP Build and Joule role collections through IAS groups rather than to individual users.
  3. Align user identifiersMake sure the identifier that reaches S/4HANA (email, login name or user ID) matches a real S/4HANA user. Mismatches are the number one cause of “works for me, fails for them”.

Destination properties

Create, or better, reuse, one destination to S/4HANA in the subaccount where SAP Build runs. Typical setups:

On-premise or Private Cloud (via Cloud Connector)

Type:            HTTP
URL:             http://s4-virtual-host:443
Proxy Type:      OnPremise
Authentication:  PrincipalPropagation
Location ID:     (your Cloud Connector location, if used)

In the Cloud Connector, expose only the service paths the agents need, and set up principal propagation trust (short-lived X.509 certificates mapped to S/4HANA users).

S/4HANA Cloud Public Edition

Type:            HTTP
URL:             https://my-xxxxx-api.s4hana.cloud.sap
Proxy Type:      Internet
Authentication:  OAuth2SAMLBearerAssertion

On the S/4HANA side, create the communication system and arrangement for the API’s communication scenario, with the BTP subaccount as the trusted identity provider.

SAP Build also needs additional properties on the destination so it shows up in actions and workflows (for example sap.applicationdevelopment.actions.enabled and sap.processautomation.enabled). Check SAP’s current SAP Build documentation for the exact list for your release.

Test user context

  • Test with two users who have different authorizations, for example one restricted to a single company code.
  • Ask both the same question. The restricted user must get less, or an authorization message.
  • Check S/4HANA security logs or traces to confirm the call ran as the end user, not a technical user.

Troubleshooting

ErrorCheck
401 UnauthorizedIAS trust, the SAML assertion audience, the certificate mapping in Cloud Connector
403 ForbiddenThe user exists, but lacks S/4HANA roles for that API or org level
Destination not visible in SAP BuildMissing SAP Build additional properties, or a different subaccount
Works in test, fails in JouleTesting used basic auth; the runtime uses user context

Frequently asked questions

What is principal propagation?

It forwards the logged-in user’s identity from SAP BTP to the backend system, so S/4HANA checks that user’s own authorizations instead of a shared technical user.

Can I use a technical user for Joule agents?

It is fine for demos and non-sensitive read-only data. For production agents that handle business data, use user propagation.

Do I need a separate destination per agent?

No. One well-configured S/4HANA destination can be reused by many actions and agents.

Keep reading

Want this built in your landscape?

We design and ship Joule agents on S/4HANA, from API layer to production.

Book a Discovery Call
© 2026 erpai.blogSAP, S/4HANA and Joule are trademarks of SAP SE. Screens show illustrative sample data.