Skip to content

midas-isg/example-midas-sso-webapp-nodejs

This branch is 14 commits ahead of, 236 commits behind auth0-samples/auth0-nodejs-webapp-sample:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e6f9358 · Jul 27, 2017

History

58 Commits
Mar 9, 2017
Mar 9, 2017
Mar 9, 2017
Mar 13, 2017
Jul 27, 2017
Mar 9, 2017
Mar 9, 2017
Jul 26, 2017
Mar 9, 2017
Mar 9, 2017
Mar 9, 2017
Mar 9, 2017

Repository files navigation

MIDAS SSO Example using Node.js

This is an example of a regular web application using Node.js, Express.js, midas-sso and Auth0.

Hook up to midass-sso

This example shows how to hook up to midass-sso and perform an authorization check for the logged in user. After user signs up to midas-sso via MIDAS Accounts, the user will automatically get ISG_USER role so that the user can access /user. This example checks for a role of ISG_ADMIN which user usually won't get and, if the user tries to access the /admin route, redirects the user to the /unauthorized.

Running the Example

Install the dependencies.

npm install

Copy .env.example to .env and replace the values for AUTH0_CLIENT_ID, AUTH0_DOMAIN, and AUTH0_CLIENT_SECRET with your Auth0 credentials. If you don't yet have an MIDAS SSO account, sign up for free.

# copy configuration and replace with your own
cp .env.example .env

Run the app.

npm start

The app will be served at http://localhost:3000.

Credit

This was forked from auth0-samples/auth0-nodejs-webapp-sample and kept only 07-Authorization.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.0%
  • HTML 22.8%
  • CSS 1.2%