Code Monkey home page Code Monkey logo

andrizan / deno-refresh-jwt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wpcodevo/deno-refresh-jwt

0.0 0.0 0.0 23 KB

In this article, you'll learn how to implement stateless authentication in Deno using JSON Web Tokens. As we all know, JSON Web Tokens can only be invalidated when they expire, so we'll include a persistent storage like Redis to serve as an extra layer of security.

Home Page: https://codevoweb.com/deno-jwt-access-and-refresh-tokens-authentication/

Shell 38.46% TypeScript 61.04% Makefile 0.49%

deno-refresh-jwt's Introduction

Deno - JWT Access and Refresh Tokens Authentication

In this article, you'll learn how to implement stateless authentication in Deno using JSON Web Tokens. As we all know, JSON Web Tokens can only be invalidated when they expire, so we'll include a persistent storage like Redis to serve as an extra layer of security.

Deno - JWT Access and Refresh Tokens Authentication

Topics Covered

  • Run the Deno JWT Authentication API Locally
  • JWT Authentication Flow
  • Flaws of Stateless JWT Authentication
    • JWT Invalidation/Revocation
    • Resource Access Denial
    • Stale Data
    • JWT can be Hijacked
  • Suggested Solution of JWT Loopholes
    • Store Revoked JWTs in a Database
    • Store JWT Metadata in a Persistence Layer
  • Setup the Deno Project
  • Setup Redis and MongoDB with Docker
  • Connect to Redis and MongoDB Servers
    • Connect to Redis Server
    • Connect to MongoDB Server
  • Create the Database Model
  • Generate the Private and Public Keys
    • Generate the Crypto Keys
    • Convert the String Keys to Crypto Keys
  • Sign and Verify the JSON Web Tokens
    • Sign the JWT
    • Verify the JWT
  • Create the Authentication Route Handlers
    • SignUp User Controller
    • Login User Controller
    • Refresh Access Token Controller
    • Logout User Controller
    • Get me Controller
  • Create an Auth Middleware Guard
  • Create the API Routes
  • Register the API Router
  • Test the JWT Authentication API
    • SignUp User
    • SignIn User
    • Get Profile Information
    • Refresh Access Token
    • Logout User

Read the entire article here: https://codevoweb.com/deno-jwt-access-and-refresh-tokens-authentication/

deno-refresh-jwt's People

Contributors

wpcodevo avatar

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.