https://github.com/satyamshorrf/authentication-authorization-jwt-token-
Authentication & Authorization | JWT Token |
https://github.com/satyamshorrf/authentication-authorization-jwt-token-
authentication authentication-backend authorization ejs-express js
Last synced: 5 months ago
JSON representation
Authentication & Authorization | JWT Token |
- Host: GitHub
- URL: https://github.com/satyamshorrf/authentication-authorization-jwt-token-
- Owner: satyamshorrf
- Created: 2024-09-07T20:40:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-07T20:44:05.000Z (almost 2 years ago)
- Last Synced: 2024-11-28T20:13:49.605Z (over 1 year ago)
- Topics: authentication, authentication-backend, authorization, ejs-express, js
- Language: EJS
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Authentication-Authorization-JWT-Token-
What is JWT?
JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. It's a digitally signed token that contains a payload of user data.
How does JWT work?
User Authentication: A user logs in with their credentials.
Token Generation: The server generates a JWT token containing the user's data, such as username, email, and role.
Token Signing: The token is digitally signed with a secret key to prevent tampering.
Token Response: The server responds with the JWT token.
Token Verification: The client includes the JWT token in subsequent requests.
Server Verification: The server verifies the token's signature and payload.
Benefits of JWT
Stateless: JWT is stateless, meaning the server doesn't need to store user data.
Secure: JWT is digitally signed, making it tamper-proof.
Scalable: JWT is lightweight and easy to handle.
Common Use Cases
Authentication: JWT is used to authenticate users.
Authorization: JWT is used to authorize users for specific actions.
Single Sign-On (SSO): JWT is used to enable SSO across multiple applications.