Code Monkey home page Code Monkey logo

jwtinvalidationexpress's Introduction

JwtInvalidationExpress

NodeJS Express server that exemplifies how to invalidate JWT's by their "issued at" claim value.

Purpose

This is a sample Express HTTP server that demonstrates how to invalidate JSON web tokens by its creation time (a. k. a. its iat claim).

It uses ES Modules and modern JavaScript syntax. While I did not test, it probably works with NodeJS v16.9.0 and above, but in all honesty, I have only ever run it in NodeJS v18. Note that the wj-config package imposes a minimum NodeJS version of 16.9.0.

Read this article for a detailed explanation of how all this works.

Have fun!

How to Run This

  1. Ensure a proper modern version of NodeJS.
  2. Clone this repository.
  3. Open bash or PowerShell in the /src folder and run npm ci.
  4. Create a MySQL database and a corresponding user.
  5. Create the MySQL table using the SQL file provided in the /sql folder.
  6. Configure your MySQL server and database details in /src/config.js.
  7. Open the repository in Visual Studio Code and just press F5 (Run command). It will work because this repository has the necessary launch.json file.
  8. If not running it with Visual Studio Code, just launch node ./src/index.js.
  9. Now the HTTP server is accessible through the URL http://localhost:7777/.

jwtinvalidationexpress's People

Contributors

webjose avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

codewithdestiny

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.