An open API service indexing awesome lists of open source software.

https://github.com/wpcodevo/hs256-rs256-jwt-nodejs

In this article, you'll learn how to generate JSON Web Tokens, commonly referred to as JWTs, in Node.js using TypeScript.
https://github.com/wpcodevo/hs256-rs256-jwt-nodejs

access-token hs256 javascript jsonwebtoken jwt jwt-tokens nodejs refresh-token rs256 rsa-key-pair typescript

Last synced: 10 months ago
JSON representation

In this article, you'll learn how to generate JSON Web Tokens, commonly referred to as JWTs, in Node.js using TypeScript.

Awesome Lists containing this project

README

          

# How to Generate and Verify JSON Web Tokens in Node.js

In this article, you'll learn how to generate JSON Web Tokens, commonly referred to as JWTs, in Node.js using TypeScript. Now, I could have just used JavaScript, but bear with me because TypeScript is now widely adopted by companies. It has become the go-to language for modern web development, and I can't even remember the last time I built a web app without TypeScript.

![How to Generate and Verify JSON Web Tokens in Node.js](https://codevoweb.com/wp-content/uploads/2023/06/How-to-Generate-and-Verify-JSON-Web-Tokens-in-Node.js.webp)

## Topics Covered

- Sign and Verify JWTs using the HS256 Algorithm
- Function to Sign the JWT with the HS256 Algorithm
- Function to Verify the JWT with the HS256 Algorithm
- Sign and Verify the JWT with the HS256 Algorithm
- Sign and Verify JWTs using the RS256 Algorithm
- Generate the RSA Private and Public Keys
- Function to Sign the JWT with the RS256 Algorithm
- Function to Verify the JWT with the RS256 Algorithm
- Sign and Verify the JWT with the RS256 Algorithm
- Generate the RSA Private and Public Keys Online
- Pros and Cons of HS256 (HMAC-SHA256)
- Pros and Cons of RS256 (RSA-SHA256)
- Conclusion

Read the entire article here: [https://codevoweb.com/generate-and-verify-json-web-tokens-in-nodejs/](https://codevoweb.com/generate-and-verify-json-web-tokens-in-nodejs/)