express-stormpath icon indicating copy to clipboard operation
express-stormpath copied to clipboard

Confusing Docs / Behavior for Applications

Open rdegges opened this issue 9 years ago • 6 comments

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.

rdegges avatar Aug 05 '16 20:08 rdegges

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?

robertjd avatar Aug 08 '16 20:08 robertjd

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.

robertjd avatar Sep 19 '16 18:09 robertjd

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.

robertjd avatar Sep 19 '16 18:09 robertjd

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.

typerandom avatar Oct 04 '16 18:10 typerandom

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.

mdeggies avatar Nov 14 '16 23:11 mdeggies

Hey @typerandom, I reviewed & commented here: https://github.com/stormpath/express-stormpath/pull/533

mdeggies avatar Nov 15 '16 02:11 mdeggies