cancel
Showing results for 
Search instead for 
Did you mean: 

Call functions in another MTA from Node js using destination services

08-14-2020 10:37 AM
sahud Participant
887 views 2 comments Go to solution
SAP Managed Tags
Subscribe

Hi Experts,

We are trying to call a node js service in different MTA Project (MTA-2) from our MTA project (MTA-1) to consume functionality in other projects. We are trying to use the destination service to connect to the other MTA Project. Please see a example diagram below:

There are 3 different projects we have:

1. UI5 Project

2. Node JS Project (Basic MTA) - Does not have an approuter

3. CAP Project - Does not have a approuter

The flow of the process is as below:

1. UI5 App Module calls MTA 2 (Node JS Project) using App Router.

2. MTA 2 provides data back to the UI. For some scenarios, MTA-2 needs to interact with MTA-1 to get data and pass back to the UI. Both MTA 1 and MTA 2 only have server modules defined in the mta.yaml and no app-router defined.

The problem we are having is when trying to connect to MTA1 from MTA 2 using a destination. We have configured a destination to the server URL for MTA 1 and using oAuth2JWTBearer Type destination to connect to the project.

When trying to get the destination configuration using the destination rest API, the auth Token is throwing the below error:

"Unable to map issuer to a single regisered provider". We have used the same destination to connect from the UI5 App to MTA1 and it works, but I understand that might be because the service call is going through the approuter.

In this scenario, we want to call server module from another server module passing the user context.

Any help is appreciated.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
SAP Mentor
SAP Mentor

I think the blog post How to call protected app | from external app || as external user ||| with scope provides you a perfect answer.

sahud
Participant
0 Likes

Thanks a lot Gregor

Answers (0)