shamshirz / stormpath-express-jwt-demo

Repository from Github https://github.comshamshirz/stormpath-express-jwt-demoRepository from Github https://github.comshamshirz/stormpath-express-jwt-demo

Express-Stormpath Example Project

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-stormpath can 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.

Get Started!

  1. 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
  1. Install the dependencies from package.json:
npm install
  1. 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
  1. Start the server:
node server.js
  1. Visit http://localhost:3000/ in your browser

  2. Checkout http://localhost:3000/routes to see what is available.

  3. After login, grab a token at http://localhost:3000/newToken.

  4. Start the dummy microservice

npm run service
  1. Hit http://localhost:3001/data to verify if your token works (aka your stormpath user has the viewData permission)

Learn More

Visit http://docs.stormpath.com/nodejs/express/latest/

Contact Stormpath Support

support@stormpath.com

About


Languages

Language:JavaScript 85.3%Language:HTML 14.7%