SlideShare a Scribd company logo
3
Most read
4
Most read
6
Most read
Presented By: Sumit
JSON WEB TOKEN
Introduction
JWT:
JSON Web Tokens (JWT) are an open, industry standard RFC 7519 method for representing
claims securely between two parties
Authorization strategies:
1) Session token
2) JSON web token
Session Token:
In the session based authentication, the server will create a session for the user after the user
logs in. The session id is then stored on a cookie on the user’s browser. While the user stays
logged in, the cookie would be sent along with every subsequent request. The server can then
compare the session id stored on the cookie against the session information stored in the
memory to verify user’s identity and sends response with the corresponding state!
Anyone Authorization mechanism session-based or JWT or any other authorization think in the
future they have one thing to blame that is HTTP.
HTTP:
HTTP is a stateless protocol. This means a HTTP server needs not keep track of any state
information. So, every Interaction in HTTP needs to contains all the needed information for that
interaction, nothing is remembered. No state is maintained over like multiple requests.
Session Token working
Session Token Problem:
Modern web app has multiple servers and has load balancer to decide which server to route the
request. Let suppose so the server could have a login request in server 1 and the session in the
memory is server-1 the next request goes throw the load balance in server-2 now server-2 is no
idea about the previous exchanges. Only server-1 is recognized the id token. 
JWT Architecture
If you can decode JWT, how are they secure ?
JWTs can be either signed, encrypted or both. If a token is signed, but not encrypted, everyone
can read its content, but when you don’t know the private key, you can’t change it. otherwise, the
receiver will notice that the signature won’t match anymore.
What happen if your json web token is stolen?
It’s a bad real bad.
Because JWT are use to identify the client , if one is stolen , an attacker has full access to the
user’s account information.
If attacker get a hold of your JWT they could start sending request to the server identifying
himself as you and do thing like make service changes , user account update etc.
Once an attacker has your JWT it is game over.
But there is one thing that make a stolen JWT slightly less bad than a stolen username and
password: timing. Because JWT can be configured to automatically expire after a set of amount
attacker only use your JWT to access the service until it expire.
One of the ways token authentication is said to make authentication more “secure” is via
short-lived token.
When should you use JSON web token?
● Authorization: This is the most common scenario for using JWT. once the user is logged in,
each subsequent request will include the JWT, allowing to user the access routes, services,
and resources that are permitted with that token.
● Information Exchange: JSON Web Tokens are a good way of securely transmitting
information between parties. Because JWT can be signed- for example using
public/private key pairs- you can be sure the sender who they say they are.
How does JWT look like?
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gR
G9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c.
JSON Web Token structure:
1) Header
2) Payload
3) Signature
HEADER:
The header typically consists of two parts: the type of the token, which is JWT, and the signing
algorithm being used, such as HMAC, SHA256 or RSA.
Payload:
The second part of the token is the payload, which contains the claims. Claims are statements
about an entity (typically, the user) and additional data.
There are three types of claims:
● Registered
● Public
● Private claims.
Registered claims:
These are the set of predefined claims which are not mandatory but recommended, to
provide a set of useful, interoperable claims. Example sub(subject), exp(expiration time) and
others.
Public claims:
These can be defined at will by those using JWTs. But to avoid collision they should be defined
in the IANA JSON Web Token Registry or be defined as a URI that contains a collision resistant
namespace.
Private claims:
These are the custom claims created to share information between parties that agree on
using them and are neither registered or public claims.
An example payload could be:
{
"sub": "1234567890",
"name": "John Doe",
"admin": true
}
Signature:
●To create the signature part you have to take the encoded header, the encoded payload, a
secret, the algorithm specified in the header, and sign that.
Putting all together:
Thank You !

More Related Content

What's hot (20)

PPTX
Pentesting jwt
Jaya Kumar Kondapalli
 
PDF
JSON Web Token
Deddy Setyadi
 
PDF
Modern API Security with JSON Web Tokens
Jonathan LeBlanc
 
PPTX
Rest API Security
Stormpath
 
PDF
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
PDF
[OPD 2019] Attacking JWT tokens
OWASP
 
PDF
Json web token
Mayank Patel
 
PDF
JSON Web Tokens
Ivan Rosolen
 
PPT
HTTP Basics
sanjoysanyal
 
PPTX
An Introduction To REST API
Aniruddh Bhilvare
 
PPTX
Understanding JWT Exploitation
AkshaeyBhosale
 
ODP
Https presentation
patel jatin
 
PDF
Jwt Security
Seid Yassin
 
PPTX
Cross site scripting
kinish kumar
 
PPTX
Wireless Penetration Testing
Mohammed Adam
 
PPTX
JSON: The Basics
Jeff Fox
 
PPTX
Web security
Padam Banthia
 
ODP
An Introduction to Hashing and Salting
Rahul Singh
 
PPTX
Web api
Sudhakar Sharma
 
PDF
Lecture 3: Servlets - Session Management
Fahad Golra
 
Pentesting jwt
Jaya Kumar Kondapalli
 
JSON Web Token
Deddy Setyadi
 
Modern API Security with JSON Web Tokens
Jonathan LeBlanc
 
Rest API Security
Stormpath
 
What is REST API? REST API Concepts and Examples | Edureka
Edureka!
 
[OPD 2019] Attacking JWT tokens
OWASP
 
Json web token
Mayank Patel
 
JSON Web Tokens
Ivan Rosolen
 
HTTP Basics
sanjoysanyal
 
An Introduction To REST API
Aniruddh Bhilvare
 
Understanding JWT Exploitation
AkshaeyBhosale
 
Https presentation
patel jatin
 
Jwt Security
Seid Yassin
 
Cross site scripting
kinish kumar
 
Wireless Penetration Testing
Mohammed Adam
 
JSON: The Basics
Jeff Fox
 
Web security
Padam Banthia
 
An Introduction to Hashing and Salting
Rahul Singh
 
Lecture 3: Servlets - Session Management
Fahad Golra
 

Similar to JSON WEB TOKEN (20)

PPTX
JWT_Presentation to show how jwt is better then session based authorization
nathakash343
 
PDF
Jwt the complete guide to json web tokens
remayssat
 
PPTX
Json web tokens
ElieHannouch
 
PPTX
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
SohailCreation
 
PDF
5 easy steps to understanding json web tokens (jwt)
Amit Gupta
 
PDF
Landscape
Amit Gupta
 
PDF
Landscape
Amit Gupta
 
PDF
OAuth and why you should use it
Sergey Podgornyy
 
PPTX
Uniface Lectures Webinar - Application & Infrastructure Security - JSON Web T...
Uniface
 
PPTX
Micro Web Service - Slim and JWT
Tuyen Vuong
 
PDF
Securing Web Applications with Token Authentication
Stormpath
 
PDF
JWT stands for JSON Web Token. It's a compact, URL-safe means of representing...
Varun Mithran
 
PDF
Jwt with flask slide deck - alan swenson
Jeffrey Clark
 
PDF
Protecting Java Microservices: Best Practices and Strategies
Rodrigo Cândido da Silva
 
PDF
[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager
WSO2
 
PDF
Using JSON Web Tokens for REST Authentication
Mediacurrent
 
PDF
Authorization Using JWTs
ForgeRock Identity Tech Talks
 
PDF
Microservices Security Landscape
Prabath Siriwardena
 
JWT_Presentation to show how jwt is better then session based authorization
nathakash343
 
Jwt the complete guide to json web tokens
remayssat
 
Json web tokens
ElieHannouch
 
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
SohailCreation
 
5 easy steps to understanding json web tokens (jwt)
Amit Gupta
 
Landscape
Amit Gupta
 
Landscape
Amit Gupta
 
OAuth and why you should use it
Sergey Podgornyy
 
Uniface Lectures Webinar - Application & Infrastructure Security - JSON Web T...
Uniface
 
Micro Web Service - Slim and JWT
Tuyen Vuong
 
Securing Web Applications with Token Authentication
Stormpath
 
JWT stands for JSON Web Token. It's a compact, URL-safe means of representing...
Varun Mithran
 
Jwt with flask slide deck - alan swenson
Jeffrey Clark
 
Protecting Java Microservices: Best Practices and Strategies
Rodrigo Cândido da Silva
 
[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager
WSO2
 
Using JSON Web Tokens for REST Authentication
Mediacurrent
 
Authorization Using JWTs
ForgeRock Identity Tech Talks
 
Microservices Security Landscape
Prabath Siriwardena
 
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
PPTX
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
PPTX
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
PPTX
Java 17 features and implementation.pptx
Knoldus Inc.
 
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
PPTX
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
PPTX
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
PPTX
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
PPTX
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
PPTX
Intro to Azure Container App Presentation
Knoldus Inc.
 
PPTX
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
PPTX
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
PPTX
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
PPTX
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Angular Hydration Presentation (FrontEnd)
Knoldus Inc.
 
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Knoldus Inc.
 
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Kanban Metrics Presentation (Project Management)
Knoldus Inc.
 
Java 17 features and implementation.pptx
Knoldus Inc.
 
Chaos Mesh Introducing Chaos in Kubernetes
Knoldus Inc.
 
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
Nomad by HashiCorp Presentation (DevOps)
Knoldus Inc.
 
DAPR - Distributed Application Runtime Presentation
Knoldus Inc.
 
Introduction to Azure Virtual WAN Presentation
Knoldus Inc.
 
Introduction to Argo Rollouts Presentation
Knoldus Inc.
 
Intro to Azure Container App Presentation
Knoldus Inc.
 
Insights Unveiled Test Reporting and Observability Excellence
Knoldus Inc.
 
Introduction to Splunk Presentation (DevOps)
Knoldus Inc.
 
Code Camp - Data Profiling and Quality Analysis Framework
Knoldus Inc.
 
AWS: Messaging Services in AWS Presentation
Knoldus Inc.
 
Amazon Cognito: A Primer on Authentication and Authorization
Knoldus Inc.
 
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Knoldus Inc.
 
Managing State & HTTP Requests In Ionic.
Knoldus Inc.
 
Ad

Recently uploaded (20)

PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
July Patch Tuesday
Ivanti
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Python basic programing language for automation
DanialHabibi2
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 

JSON WEB TOKEN

  • 2. Introduction JWT: JSON Web Tokens (JWT) are an open, industry standard RFC 7519 method for representing claims securely between two parties Authorization strategies: 1) Session token 2) JSON web token
  • 3. Session Token: In the session based authentication, the server will create a session for the user after the user logs in. The session id is then stored on a cookie on the user’s browser. While the user stays logged in, the cookie would be sent along with every subsequent request. The server can then compare the session id stored on the cookie against the session information stored in the memory to verify user’s identity and sends response with the corresponding state! Anyone Authorization mechanism session-based or JWT or any other authorization think in the future they have one thing to blame that is HTTP. HTTP: HTTP is a stateless protocol. This means a HTTP server needs not keep track of any state information. So, every Interaction in HTTP needs to contains all the needed information for that interaction, nothing is remembered. No state is maintained over like multiple requests.
  • 5. Session Token Problem: Modern web app has multiple servers and has load balancer to decide which server to route the request. Let suppose so the server could have a login request in server 1 and the session in the memory is server-1 the next request goes throw the load balance in server-2 now server-2 is no idea about the previous exchanges. Only server-1 is recognized the id token. 
  • 7. If you can decode JWT, how are they secure ? JWTs can be either signed, encrypted or both. If a token is signed, but not encrypted, everyone can read its content, but when you don’t know the private key, you can’t change it. otherwise, the receiver will notice that the signature won’t match anymore.
  • 8. What happen if your json web token is stolen? It’s a bad real bad. Because JWT are use to identify the client , if one is stolen , an attacker has full access to the user’s account information. If attacker get a hold of your JWT they could start sending request to the server identifying himself as you and do thing like make service changes , user account update etc. Once an attacker has your JWT it is game over. But there is one thing that make a stolen JWT slightly less bad than a stolen username and password: timing. Because JWT can be configured to automatically expire after a set of amount attacker only use your JWT to access the service until it expire. One of the ways token authentication is said to make authentication more “secure” is via short-lived token.
  • 9. When should you use JSON web token? ● Authorization: This is the most common scenario for using JWT. once the user is logged in, each subsequent request will include the JWT, allowing to user the access routes, services, and resources that are permitted with that token. ● Information Exchange: JSON Web Tokens are a good way of securely transmitting information between parties. Because JWT can be signed- for example using public/private key pairs- you can be sure the sender who they say they are.
  • 10. How does JWT look like?
  • 12. JSON Web Token structure: 1) Header 2) Payload 3) Signature HEADER: The header typically consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC, SHA256 or RSA.
  • 13. Payload: The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional data. There are three types of claims: ● Registered ● Public ● Private claims. Registered claims: These are the set of predefined claims which are not mandatory but recommended, to provide a set of useful, interoperable claims. Example sub(subject), exp(expiration time) and others.
  • 14. Public claims: These can be defined at will by those using JWTs. But to avoid collision they should be defined in the IANA JSON Web Token Registry or be defined as a URI that contains a collision resistant namespace. Private claims: These are the custom claims created to share information between parties that agree on using them and are neither registered or public claims. An example payload could be: { "sub": "1234567890", "name": "John Doe", "admin": true }
  • 15. Signature: ●To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that.