cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing protected CAP service in HTML5 app of other MTA project.

mantri_sagar
Explorer

I have 2 projects, one with protected CAP service using managed app router and another MTA project with HTML5 application which is also using managed app router. When I try to access protected service in HTML5 app of other MTA project I get 401 unauthorized error but when I try to access service without roles in HTML5 app of other MTA project it works fine.

Is there any specific steps need to be followed to access protected service in HTML5 app ?

I have tried xs-security.json and xs-app.json configuration as per below blog, but couldn't do server.js changes as my second project is MTA project with HTML5 app not CAP service.

https://blogs.sap.com/2020/06/02/how-to-call-protected-app-from-external-app-as-external-user-with-s...

Kind Regards,

Sagar

soumya_goud_
Discoverer
0 Kudos

Hello mansag

I have the similar issue with my project. Have you been able to solve this ?

Thanks,

Soumya

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi mansag & soumya_goud_,

I believe you have to link the two MTA's so the App Router can submit the JWT between applications.

Here is how you can do this:

https://blogs.sap.com/2021/03/10/split-mta-into-backend-frontend-standalone-approuter/

Make sure all your modules that require authenticated users are bound to the same instance of XSUAA.

Best regards,
Ivan