Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Authenticating via JWT using express route middleware

dynamicsingh/node-jwt-auth-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

node-jwt-authentication-app

Demonstrating authentication by verifying a token using Express route middleware.

Requirements

  • node, npm, express and mongoose

Usage

  1. Clone the repo
  2. Install dependencies: npm install
  3. Change SECRET in config.js
  4. Add your own MongoDB database to config.js
  5. Start the server: node server.js
  6. Create sample user by visiting: http://localhost:3000/setup

Once everything is set up, we can begin to use our app by creating and verifying tokens.

Getting a Token

Send a POST request to http://localhost:3000/api/authenticate.

Verifying a Token and Listing Users

You can also send the token as a URL parameter: http://localhost:3000/api/users?token=YOUR_TOKEN_HERE

About

Authenticating via JWT using express route middleware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /