A simple Express.js web application to demonstrate core Stormpath functionality. In this application you can see:
- The default registration and login pages that
express-stormpathcan provide to your application. - How you can require authentication for custom API routes.
- Updating the custom data of the Stormpath user object, with a custom profile form.
- Cross-domain authentication, when CORS is required.
- Clone this repo to your computer, and cd into the project directory:
git clone https://github.com/stormpath/express-stormpath-sample-project.git
cd express-stormpath-sample-project- Install the dependencies from package.json:
npm install- Export your Stormpath API Key ID / Secret and Application HREF Environment Variables:
export STORMPATH_CLIENT_APIKEY_ID=xxx
export STORMPATH_CLIENT_APIKEY_SECRET=xxx
export STORMPATH_APPLICATION_HREF=xxx- Start the server:
node server.js-
Visit http://localhost:3000/ in your browser
-
Checkout http://localhost:3000/routes to see what is available.
-
After login, grab a token at http://localhost:3000/newToken.
-
Start the dummy microservice
npm run service- Hit http://localhost:3001/data to verify if your token works (aka your stormpath user has the viewData permission)