Reputation: 4000
I'm trying to use stormpath within my heroku application but I'm confused about the purpose of the STORMPATH_URL
environment variable exposed to my application.
This variable holds the URL to my Stormpath Application, not to stormpath server URL. So if I used the value of this environment variable to set the base URL to the stormpath server, my calls won't work and fire a 404 exception
HTTP 404, Stormpath 404 (mailto:[email protected]), RequestId xxxxx-xxxx-xxxx-xxx The requested resource does not exist.
But if I leave the client's base URL empty to use the default Stormpath server URL, everything working fine. So what is the purpose of having this environment varibale exposed to my application?
I can see that this URL points to my Stormpath Application, so why do I need it since I can already get my Stormpath Application using it's name?
Upvotes: 2
Views: 47
Reputation: 53600
The purpose of the STORMPATH_URL
environment variable (or STORMPATH_APPLICATION_HREF
, same thing) is to tell your Heroku application which Stormpath Application resource it should be "associated" with. A Stormpath Application represents your real-world app that has users, roles, and so on. When your Heroku dyno spins up, it needs to know which Application resource it should use to authenticate users, etc.
You're right that you could just look up your Stormpath Application by name, instead of href, but looking up via href is faster. :)
You normally don't have to touch this variable. If you have your Heroku application pointed at the correct Application resource URL in your Stormpath backend, it should just work!
Upvotes: 2