express-stormpath
express-stormpath copied to clipboard
Confusing Docs / Behavior for Applications
The quickstart docs (https://docs.stormpath.com/nodejs/express/latest/setup.html#initialize-express-stormpath) suggest that all configuration is optional so long as the API key file is available as ~/.stormpath/apiKey.properties.
I've got a Stormpath tenant with a ton of Applications in it, and this does work without having me specify an Application, but this seems really confusing. I think the desired behavior should be that we throw an error if there are more than 2 applications, and force the developer to specify the application they want to use.
We should also update the documentation in the quickstart linked above to talk about this.
Yeah, we should discuss API Key configuration and application configuration before showing how to start the application.
If you don't specify an application (and you have many), you should get this error:
error: Error: Could not automatically resolve a Stormpath Application.
Please specify your Stormpath Application in your configuration.
@rdegges Did you see something else?
Can anyone reproduce the problem that @rdegges mentioned? The one where you don't get an error if you don't specify an application, while having more than 1 (that is not Stormpath Administrators) in your stormpath tenant? I can't.
The other issue here, which is to clean up our documentation of configuration, should still be addressed.
Also: we need to change the documentation to show all client options being passed in with the client object:
app.use(stormpath.init(app, {
client: {
apiKey: {
id: 'xxx',
secret: 'xxx'
},
}
}));
Right now we do allow you to pass apiKey etc as a root property, i.e. a sibling of web, but I want us to remove that in the next major version.
Can anyone reproduce the problem that @rdegges mentioned? The one where you don't get an error if you don't specify an application, while having more than 1 (that is not Stormpath Administrators) in your stormpath tenant? I can't.
I'm not able to replicate this issue that Randall is seeing.
I can't reproduce @rdegges' report either. With my API key ID/secret in ~/.stormpath/apiKey.properties, and no environment variables set, I get this error:
error: Error: Could not automatically resolve a Stormpath Application. Please specify your Stormpath Application in your configuration.
Hey @typerandom, I reviewed & commented here: https://github.com/stormpath/express-stormpath/pull/533