I am trying to use express-stormpath in my Heroku application. I follow the docs here and my code is very simple:
var express = require('express');
var app = express();
var stormpath = require('express-stormpath');
app.use(stormpath.init(app, {
website: true
}));
app.on('stormpath.ready', function() {
app.listen(3000);
});
I already covered this question and followed Heroku devcenter docs . The docs say that it is not necessary for Heroku to pass parameters, but I still tried to use the options and nothing works. For example, I tried this:
app.use(stormpath.init(app, {
client: {
apiKey: {
file: './xxx.properties',
id: process.env.STORMPATH_API_KEY_ID || 'xxx',
secret: process.env.STORMPATH_API_KEY_SECRET || 'xxx'
}
},
application: {
href: 'https://api.stormpath.com/v1/applications/blah'
},
}));
To try to see what happens, I added the console.log line to the stormpath-config valpath template strategy to print the client object, and this gives me the following:
{ file: './apiKey-xxx.properties',
id: 'xxx',
secret: 'xxx' }
{ file: null, id: null, secret: null }
Error: API key ID and secret is required.
, , id secret?
heroku config | grep STORMPATH,
STORMPATH_API_KEY_ID: xxxx
STORMPATH_API_KEY_SECRET: xxxx
STORMPATH_URL: https://api.stormpath.com/v1/applications/[myappurl]