SAP / SAP/cloud-sdk-js

Not able to call getDestinationFromDestinationService in multitenant CAP scenario

Open
#3,067 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CAP
Dominant language
TypeScript
Stars
219
Forks
74
Avg merge
1d 2h
Merged PRs (30d)
60

Description

I am not able to call serviceB from serviceA (both in a provider account) using CAP with multitenancy enabled.

Scenario:
Subscriber Account A -- calls --> ProviderServiceA -- calls (using destination) --> ProviderServiceB.

Internally getDestinationFromDestinationService gets called with the option "alwaysProvider".

The problem here seems to be, that even when "alwaysProvider" is set, the method getDestinationFromDestinationService will still try to fetch a token for the subscriber, using the following information:

  • auth endpoint: subscriber auth endpoint (fetched from user token coming from subscriber)
  • credentials of destination-service: fetched from provider destination service binding

So it tries to authenticate using the provider destination credentials against the subscriber auth endpoint. This of course does not work and the method fails with an error.

I would expect, if "alwaysProvider" is set, that it does not even try to get a subscriber token first, since this will always fail.

Am I missing something here, or is this maybe a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing getDestinationFromDestinationService and its alwaysProvider option in the TypeScript SDK, then reproduce the provider-service-to-provider-service call in the described multitenant scenario. Done means the provider destination credentials are not used against the subscriber auth endpoint when alwaysProvider is set, and the destination call succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.