Skip to content

Simple login process with tokens to keep user account more secure. Using: Node.js/Express.js, Jwt (json web token)/ access and refresh tokens, axios interceptors/instance, Vite.js ๐Ÿš€

Notifications You must be signed in to change notification settings

UlfetZakirli/JWT_Authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

JWT_Authentication

Used Technologies

  • Node.js
  • Express.js
  • JWT (JSON Web Token), accessToken/refreshToken
  • Vite.js
  • Axios (axios.interceptors, axios instance)

first

second

What is JSON Web Token?

JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA.

When should you use JSON Web Tokens?

Authorization: This is the most common scenario for using JWT. Once the user is logged in, each subsequent request will include the JWT, allowing the user to access routes, services, and resources that are permitted with that token. Single Sign On is a feature that widely uses JWT nowadays, because of its small overhead and its ability to be easily used across different domains.

Information Exchange: JSON Web Tokens are a good way of securely transmitting information between parties. Because JWTs can be signedโ€”for example, using public/private key pairsโ€”you can be sure the senders are who they say they are. Additionally, as the signature is calculated using the header and the payload, you can also verify that the content hasn't been tampered with.

What is the JSON Web Token structure?

In its compact form, JSON Web Tokens consist of three parts separated by dots (.), which are:

  • Header
  • Payload
  • Signature

Therefore, a JWT typically looks like the following.

xxxxx.yyyyy.zzzzz

jwt

About

Simple login process with tokens to keep user account more secure. Using: Node.js/Express.js, Jwt (json web token)/ access and refresh tokens, axios interceptors/instance, Vite.js ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published