stormpath / express-stormpath

Build simple, secure web applications with Stormpath and Express!
http://docs.stormpath.com/nodejs/express/
Apache License 2.0
325 stars 111 forks source link

Configuring for multiple applications on the same machine #604

Open SanzSeraph opened 7 years ago

SanzSeraph commented 7 years ago

I'm developing an app that may (by no decision of mine) run alongside other applications that integrate stormpath. However, as far as I can tell from the documentation, there is no good way to do this. You could include the API keys in the .init() call, but the docs warn against this as it is not a best practice. On the other end of the spectrum, the documentation recommends putting them in environment variables, but environment variables (at least ones that persist across shell sessions) are global, and thus are not suited to a multiple application environment.

The only thing I can think of is to create a dedicated user for each application with its own home folder to store the application-specific API keys. That seems like a clean solution, but it also seems like a lot of trouble. Why can't the path to the API key file be configured as an inline option?