cancel
Showing results for 
Search instead for 
Did you mean: 

Authentication with SAP BTP while developing

Reinhardt
Explorer
0 Kudos
458

Hi Experts,

I'll try to be as brief as possible - I have a front-end and back-end applications that i'm developing in SAP Business Application Studio.

Back-end is a node.js server using the express npm package.

Front-end is a fiori application.

I am utilizing "async await fetch" in my Fiori Controller Javascript to GET and POST from the Node.Js express server.

I have applied necessary CORS configuration to the Node.Js express server.

I run both applications from the terminal in Business Application Studio. I can successfully GET the endpoint on the back-end and retrieve results in the browser (because i'm logged into my S-User and authenticate with BTP).

However, when my front-end app does the GET request, I get 401, so I add Authentication header with Basic + base64string with username:password. Then I get CORS error.

Kindly explain the method for authenticating between two apps while developing in the BAS?

I've attached code screenshots.

Much Appreciated,

Reinhardt

View Entire Topic
PeterRoehlen
Participant
0 Kudos

Hi, in those types of situations (CORS errors, non-SAP backend) I've found I've had to use a proxy middleware when running my app in BAS like this one:

https://www.npmjs.com/package/@sap-ux/backend-proxy-middleware