Skip to content

Commit 5cb82cc

Browse files
davidhunglamStefanHenkerenejeglinsky
authored
Update remote-services.md (#2630)
Added subsection about configuring `on-behalf-of` for IAS app-2-app destinations. --------- Co-authored-by: Stefan Henke <stefan.henke@sap.com> Co-authored-by: René Jeglinsky <rene.jeglinsky@sap.com>
1 parent 10aeacf commit 5cb82cc

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

java/cqn-services/remote-services.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,38 @@ At runtime, this destination configuration will use the bound `identity` service
213213

214214
[Learn more about consuming APIs from other IAS-Applications in the **SAP Cloud Identity Services documentation**.](https://help.sap.com/docs/cloud-identity-services/cloud-identity-services/consume-apis-from-other-applications){.learn-more}
215215

216+
##### Configuring the Authentication Strategy
217+
218+
By default, when calling a remote IAS-based API through a destination, CAP propagates the user identity associated with the current `RequestContext` (`currentUser`). If the `RequestContext` contains a named user, CAP propagates the named user. If not, CAP requests a technical user token.
219+
220+
For background processing or technical integrations, you may want to force the remote API call to use a technical user. Use the `destination.onBehalfOf` configuration to control this behavior:
221+
222+
::: code-group
223+
```yaml [srv/src/main/resources/application.yaml]
224+
cds:
225+
remote.services:
226+
RemoteIasService:
227+
destination:
228+
name: my-ias-destination
229+
onBehalfOf: systemUser
230+
```
231+
232+
The following options are available:
233+
234+
| Value | Description |
235+
|-------|-------------|
236+
| `currentUser` | Propagates the named user if available, or falls back to a tenant-specific technical user. **(default)** |
237+
| `systemUser` | Uses a tenant-specific technical user, based on the tenant set in the current Request Context. |
238+
| `systemUserProvider` | Uses a technical user of the provider tenant. Useful for internal communication that does not require tenant-specific authorization. |
239+
240+
::: tip Behaves similar to binding-based configuration
241+
This behaves identically to the [`onBehalfOf` option in binding-based configurations](#configuring-the-authentication-strategy). Use it when your IAS app-2-app communication is configured via a BTP destination with `cloudsdk.ias-dependency-name` rather than a direct service binding.
242+
:::
243+
244+
::: warning Only applicable to IAS app-2-app destinations
245+
The `onBehalfOf` option applies only to IAS app-2-app destinations (destinations with the `cloudsdk.ias-dependency-name` property set). It has no effect on other destination types.
246+
:::
247+
216248
#### Retrieve Destinations
217249

218250
The CAP Java SDK obtains the destination for a _Remote Service_ from the `DestinationAccessor` using the name that is configured in the _Remote Service_'s destination configuration.

0 commit comments

Comments
 (0)