Thursday 4 May 2017

How to store private key from service account credentials as an environment variable?

In the Ggoogle OAuth documentation it recommends that you store you're private key securely for both development and production:

Note: You must store and manage private keys securely in both development and production environments. Google does not keep a copy of your private keys, only your public keys.

I'm developing a Node app that I'll deploy to Heroku so my preferred method of storing these types of things is as an environment variable. The credentials I've been given by google are in a JSON file and from what I can tell I need to keep it in this format in order to keep authentication simple.

Does anyone know if you can read in environment variables into a JSON file? If this isn't possible, does anyone have any suggestions for how I should store these private keys?



via quicklikerabbit

No comments:

Post a Comment