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.
- Host: GitHub
- URL: https://github.com/wpcodevo/hs256-rs256-jwt-nodejs
- Owner: wpcodevo
- Created: 2023-06-02T09:18:06.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-02T10:06:41.000Z (about 3 years ago)
- Last Synced: 2025-04-13T18:33:31.363Z (about 1 year ago)
- Topics: access-token, hs256, javascript, jsonwebtoken, jwt, jwt-tokens, nodejs, refresh-token, rs256, rsa-key-pair, typescript
- Language: TypeScript
- Homepage: https://codevoweb.com/generate-and-verify-json-web-tokens-in-nodejs/
- Size: 15.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.

## 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/)