AnsweredAssumed Answered

PI Web API + NodeJS Authentication

Question asked by engineertdog on Apr 14, 2020

I am using axios to make requests to PI Web API where needed (currently being requested from the Vue application). And while having the users log in to make the requests works, it's not a good design implementation. The application I'm building is going to make requests to numerous PI Web API services, and it doesn't make sense to require the user to enter their login info for every server they need to get data from. 

 

The design of the application should be that the NodeJS application would make all requests to the PI Web API endpoints. However, because user credentials are not passed to the NodeJS application (and there are requests that will be made through cron jobs), the requests fail due to being unauthorized. I'm not for using basic auth to make the requests, because that's just plain wrong.

 

How would you properly handle authenticated (non-basic auth) requests to the PI Web API with NodeJS?

Outcomes