Skip to content

In this article, you'll learn how to implement JSON Web Token authentication with access and refresh tokens using the Web Cryptography API provided in Deno.

Notifications You must be signed in to change notification settings

wpcodevo/deno-rs256-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno - Refresh JWT Access Token with Private and Public Keys

In this article, you'll learn how to implement JSON Web Token authentication with access and refresh tokens using the Web Cryptography API provided in Deno. The Web Crypto API is a low-level interface for performing cryptographic operations such as hashing, signature generation and verification, encryption, and decryption.

Deno - Refresh JWT Access Token with Private and Public Keys

Topics Covered

  • Run the Deno JWT Project Locally
  • Setup Deno
  • Generate the Private and Public Keys
  • Convert the Keys to CryptoKeys
  • Sign and Verify the JSON Web Tokens
    • Sign the JWT with the RS256 Algorithm
    • Verify the JWT with Asymmetric Keys
  • Create Authentication Route Handlers
    • Register User Controller
    • Login User Controller
    • Refresh Token Controller
    • Logout User Controller
  • Create a GetMe Router Handler
  • Create an Authentication Guard
  • Create the API Routes
  • Add the API Router to the App
  • Testing the JWT Authentication Flow in Postman
    • Register User
    • Login User
    • Refresh Access Token
    • Get Authentication User
    • Logout User

Read the entire article here: https://codevoweb.com/deno-jwt-authentication-with-private-and-public-keys/