0% found this document useful (0 votes)
5 views5 pages

JSON Web Token: Ammar Munir

Uploaded by

Kuvarji Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

JSON Web Token: Ammar Munir

Uploaded by

Kuvarji Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

JWT

JSON Web Token

Ammar Munir
WHAT
JWT is a compact, URL-safe method of representing claims
to be transferred between two parties. It is commonly used
for authentication and authorization in web applications,
allowing the secure exchange of information. The token is
digitally signed using a secret (HMAC) or a public/private
key pair (RSA or ECDSA).

Components of a JWT
Header Payload Signature

Ammar Munir
Header

Contains metadata about the token, including the type of

token (JWT) and the signing algorithm used (e.g., HMAC

SHA256 or RSA).

Payload

Contains the claims. Claims are statements about an entity

(typically, the user) and additional metadata. 


There are three types of claims

Registered claims: Predefined claims like iss (issuer),

exp (expiration), and sub (subject)

Public claims: Custom claims that are not registered,

but defined by the user (e.g., user_id, email)

Private claims: Claims agreed upon by both parties

(e.g., permissions or roles).

Signature

The result of signing the encoded header, encoded

payload, and a secret key. It ensures the integrity of the

token and verifies the authenticity of the sender.

Ammar Munir
CREATE OWN

JWT

Ammar Munir
Ammar Munir
linktree/ammar.munirr

WAS IT HELPFUL ?
Follow Now

You might also like