🔏
starhackit
  • README
  • Getting started
    • Requirements
    • Quick Start
  • Frontend
    • The Frontend
      • Npm scripts
    • Unit testing
    • End 2 End Testing
    • Multi Application
    • Production Build
    • Internationalization
    • Configuration
    • Cut and Paste detector
    • Webpack
  • Backend
    • Node Backend
      • Npm scripts
    • Development Enviromnent with docker-compose
    • Testing
      • Code Coverage
    • Configuration
    • Debugging
    • Database
    • Http Server
      • CORS
    • Authentication
      • Social Authentication
      • Local Authentication with JWT
    • Email
    • Redis
    • Api Model
      • Api Mocking
  • Deployment
    • Build, Tag and Push Docker Images
    • Releasing
    • Deploy Infrastructure with GruCloud
    • Deploy with Ansible
Powered by GitBook
On this page

Was this helpful?

  1. Backend
  2. Authentication

Local Authentication with JWT

PreviousSocial AuthenticationNextEmail

Last updated 5 years ago

Was this helpful?

is a modern alternative to HTTP cookie for authentication purposes.

is the node library which implements such a protocol.

A sequence diagram a worth a thousand words:

Json Web Token Sequence Diagram

Please change the following configuration according to your need, especially the secret.

"jwt": {
  "secret": "I love shrimp with mayonnaise",
  "options": {
    "expiresIn": "15 days"
  }
}

For a list of all available options, please consult the

node-jsonwebtoken documentation
Json Web Token
node-jsonwebtoken