1

I have a typical MEAN stack with an Angular front-end and I'm using Express to build out the API. The site has user accounts, and I am using Passport.js for my authentication middleware. All of this is working great.

I would like to secure the API endpoints somehow so that only my application can call them, but without interfering with the user authentication. What is a good mechanism for this?

amnesia
  • 1,956
  • 2
  • 18
  • 36
  • Similar question on this [link](http://stackoverflow.com/questions/28251404/best-way-to-secure-private-rest-api-without-user-authentication-for-mobile-app) – amin arghavani Jan 31 '17 at 21:49

1 Answers1

0

Hapi.js is now coming to the front for secure routing while separating business logic for node.js builds.

hapi.js

About: Hapi.js was built by an WalMart employee before black friday.

Articles:

Express to Hapi.js

Using hapi.js with Socket.io

More: hapi was created around the idea that configuration is better than code, that business logic must be isolated from the transport layer, and that native node constructs like buffers and stream should be supported as first class objects. But most importantly, it was created to provide a modern, comprehensive environment in which as much of the effort is spent delivering business value.

"We used Express for a few months until we hit a wall.

Some of the features we needed required a cleaner isolation between the node HTTP server, the router (the part matching requests to handlers), and the actual business logic"

Resources

WalMart's Use case

Leroy Thompson
  • 470
  • 3
  • 13
  • It's an interesting project, but telling me to rewrite my app in an entirely different framework is not really the answer I was looking for. – amnesia Aug 02 '16 at 02:20
  • On front-end I focus on nested anonymous functions/events authenticated by the server, logging of user information, prevent duplicate logins /per location/browser/tab/device, device signature login, ect... I'm new to node.js so I can't dive-in into security on back-end and I hope the post above helps somebody. – Leroy Thompson Aug 02 '16 at 02:29