Skip to content

Add Node.js part to Outbound Authentication#2596

Open
vkozyura wants to merge 16 commits into
mainfrom
outbound-auth-node
Open

Add Node.js part to Outbound Authentication#2596
vkozyura wants to merge 16 commits into
mainfrom
outbound-auth-node

Conversation

@vkozyura

Copy link
Copy Markdown
Contributor

No description provided.

@vkozyura vkozyura requested a review from renejeglinsky as a code owner May 28, 2026 08:27
@vkozyura vkozyura marked this pull request as draft May 28, 2026 08:27
@vkozyura vkozyura marked this pull request as ready for review June 5, 2026 13:13
@PDT42 PDT42 self-requested a review June 15, 2026 08:39

@PDT42 PDT42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this guide should use the Java / Node.js switch, if that is still a thing? The examples and required steps seem pretty disconnected.

Comment thread guides/security/remote-authentication.md
Comment thread guides/security/remote-authentication.md Outdated
Comment thread guides/security/remote-authentication.md Outdated
Comment thread guides/security/remote-authentication.md Outdated
Comment thread guides/security/remote-authentication.md
Comment thread guides/security/remote-authentication.md
Comment thread guides/security/remote-authentication.md Outdated
Comment thread guides/security/remote-authentication.md
Comment thread guides/security/remote-authentication.md Outdated
Comment thread guides/security/remote-authentication.md Outdated
@renejeglinsky

Copy link
Copy Markdown
Contributor

Perhaps this guide should use the Java / Node.js switch, if that is still a thing?

It's not a thing anymore. But code groups that have Java/Node are now remembered by selection without the toggle.

@vkozyura vkozyura requested a review from danjoa as a code owner June 16, 2026 08:42
@vkozyura vkozyura requested a review from PDT42 June 16, 2026 08:44
Comment thread guides/security/remote-authentication.md Outdated
PDT42
PDT42 previously approved these changes Jun 16, 2026

@PDT42 PDT42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still having trouble with the structure: I think intermixing the Java and Node.js guides like this doesn't provide much benefit and is at least a bit confusing ... However, the documented process (without trying to go through it myself) makes sense to me.

Comment on lines 88 to 165
@@ -105,36 +105,73 @@ cds:
options:
url: https://<xflights-srv-cert url>
```
```json [Node.js: package.json]
{
"cds": {
"requires": {
"sap.capire.flights.data": {
"kind": "hcql",
"[production]": {
"credentials": {
"url": "https://<xflights-srv-cert url>/hcql/data",
"forwardAuthToken": true
}
}
}
}
}
}
```
:::

::: details Java configuration explained

The `type` property activates the protocol for exchanging business data and must be offered by the provider [CDS service](https://github.com/capire/xflights-java/blob/6fc7c665c63bb6d73e28c11b391b1ba965b8772c/srv/data-service.cds#L24).
The `model` property needs to match the fully qualified name of the CDS service from the imported model.
You can find CDS service definition of `sap.capire.flights.data` in file `target/cds/capire/xflight-data/service.cds` resolved during CDS build step.
The `binding.name` needs to point to the shared identity instance and `options.url` together with `http.suffix` provides the required location of the remote service endpoint.
Finally, `onBehalfOf: systemUser` specifies that the remote call is invoked on behalf of a technical user in context of the tenant.

::: tip
On behalf of `systemUser` works both in pure single tenant and in pure multitenant scenarios.
On behalf of `systemUser` (Java) works both in pure single tenant and in pure multitenant scenarios.
If you are consuming a single tenant service from within a multitenant application choose on behalf of `systemUserProvider`.

:::

::: details Node.js configuration explained

The configuration follows the standard pattern for [required services](../integration/reuse-and-compose#configuring-required-services) with [service bindings](../integration/reuse-and-compose#binding-required-services).

For co-located services sharing the same identity instance, `forwardAuthToken: true` forwards the incoming JWT directly to the provider - no token exchange needed since the token is already valid. Unlike Java's `onBehalfOf` option, no additional configuration is required as the original user context is preserved in the forwarded token.

:::



Now you are ready to deploy the application with

```sh
cd ./xtravels_java
::: code-group
```sh [Java]
cd ./xtravels-java
cds up
```

```sh [Node.js]
cd ./xtravels
cds up
```
:::

❗Note that CF application `xtravels-srv` will not start successfully as long as `xflights` is not deployed yet (step 3).

@renejeglinsky renejeglinsky Jun 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how this part now looks like.

Image

WDYT? @PDT42 @vkozyura

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could/should do that throughout the document. I think this makes a nicer flow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just included it in my changes. Please have a look if you have any objections against one/some of my edits.

Comment on lines 153 to 163
::: code-group
```sh [Java]
cd ./xtravels_java
cd ./xtravels-java
cds up
```

```sh [Node.js]
cd ./xtravels
cds up
```
:::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the result of this? If we state this, I think it's clearer what we talk about in the rest of the document:

  • xtravels-srv server
  • xtravels-ias service instance
  • xtravels-db service instance?
  • more?

@@ -90,6 +87,7 @@

As client, `xtravels-srv` first needs a valid configuration for the remote service `sap.capire.flights.data`:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd argue that this cannot be called xtravels-srv yet. We should only use it when it is important to differentiate between xtravels and the deployed server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants