SlideShare a Scribd company logo
3
Most read
7
Most read
10
Most read
JSON Web Token
(JWT)
Prashant Walke
Overview
What is JSON Web Token?
JSON Web Tokens Uses
● Authorization
● Information Exchange
How do JSON Web Tokens work
What is 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.
JSON Web Tokens Uses
Authorization
● 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.
Information Exchange
● JSON Web Tokens are a
good way of securely
transmitting information
between parties
Why should we use JSON Web Tokens?
● Security - Securely transmitting information between parties using public/private key
pairs
● Ease - Ease of client-side processing of the JSON Web token on multiple platforms,
especially mobile.
● Compact -Because of its size, it can be sent through an URL, POST parameter, or
inside an HTTP header. Additionally, due to its size its transmission is fast.
● Self-Contained - The payload contains all the required information about the user, to
avoid querying the database more than once.
How do JSON Web Tokens
work?
JWT format
header.payload.signature
● Header - consists of two parts: the type of the token, which is
JWT, and the signing algorithm being used, such as HMAC
SHA256 or RSA.
For example: {
"alg": "HS256",
"typ": "JWT"
}
JWT format
header.payload.signature
● Payload- Contains the claims. Claims are statements about
an entity (typically, the user) and additional data. There are
three types of claims: registered, public, and private claims.
For example: {
"user_id": "4"
}
JWT format
header.payload.signature
● 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.
For example (HMAC SHA256 algorithm):
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
secret)
JWT format
Authentication
Server
User Sign In ([username/password])
User Authenticated, JWT Created and return to USER
1
2
{header.payload.signature
}
{JWT}
User
Application
Server
User passes [JWT] When making API Calls3
Application verifies and processes API Call4
JWT to verify the authenticity of a user
● User first signs into the authentication server using the authentication server’s login
system (e.g. username and password, Facebook login, Google login, Twitter etc).
● The authentication server then creates the JWT and sends it to the user.
● When the user makes API calls to the application, the user passes the JWT along with
the API call.
● In this setup, the application server would be configured to verify that the incoming
JWT are created by the authentication server
● When the user makes API calls with the attached JWT, the application can use the JWT
to verify that the API call is coming from an authenticated user.
Conclusion
Definitely having reliable way to
authenticate user is the first thing
on the list and using JWT
Authentication as an best
authentication method.

More Related Content

PDF
JSON WEB TOKEN
PDF
Introduction to JWT and How to integrate with Spring Security
PPTX
Understanding GIT and Version Control
PPTX
API Design- Best Practices
PPTX
Power Point Presentation on Artificial Intelligence
PPTX
REST & RESTful Web Services
PPTX
Flutter presentation.pptx
PPTX
Introduction to GraphQL Presentation.pptx
JSON WEB TOKEN
Introduction to JWT and How to integrate with Spring Security
Understanding GIT and Version Control
API Design- Best Practices
Power Point Presentation on Artificial Intelligence
REST & RESTful Web Services
Flutter presentation.pptx
Introduction to GraphQL Presentation.pptx

What's hot (20)

PDF
Json web token
PPTX
Pentesting jwt
PDF
JSON Web Token
PPTX
Understanding JWT Exploitation
PDF
Jwt Security
PDF
Using JSON Web Tokens for REST Authentication
PPTX
Spring boot Introduction
PPTX
Introduction to spring boot
PDF
Nodejs presentation
PPTX
An Introduction To REST API
ODP
Introduction to Spring Framework and Spring IoC
PDF
JSON Web Tokens
PDF
Introduction to django framework
PDF
Spring Boot
PDF
[OPD 2019] Attacking JWT tokens
PDF
Modern API Security with JSON Web Tokens
ODP
Introduction to Swagger
ODP
Routing & Navigating Pages in Angular 2
Json web token
Pentesting jwt
JSON Web Token
Understanding JWT Exploitation
Jwt Security
Using JSON Web Tokens for REST Authentication
Spring boot Introduction
Introduction to spring boot
Nodejs presentation
An Introduction To REST API
Introduction to Spring Framework and Spring IoC
JSON Web Tokens
Introduction to django framework
Spring Boot
[OPD 2019] Attacking JWT tokens
Modern API Security with JSON Web Tokens
Introduction to Swagger
Routing & Navigating Pages in Angular 2
Ad

Similar to Json Web Token - JWT (20)

PPTX
Json web tokens
PDF
Angular - Chapter 9 - Authentication and Authorization
PPTX
Micro Web Service - Slim and JWT
PDF
Jwt with flask slide deck - alan swenson
PDF
iMasters Intercon 2016 - Identity within Microservices
PDF
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
PPTX
Towards Interoperability between W3C Web of Things and NGSI-LD
PDF
Introduction to SAML & OIDC
PDF
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
PPTX
Building IAM for OpenStack
PDF
The OpenID Connect Protocol
PDF
5 easy steps to understanding json web tokens (jwt)
PDF
2016 pycontw web api authentication
PPT
Securing RESTful API
PPTX
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
PPTX
JsonWebTokens ppt - explains JWT, JWS , JWE Tokens
PPT
Scalable Reliable Secure REST
PDF
PPT
Ssl https
Json web tokens
Angular - Chapter 9 - Authentication and Authorization
Micro Web Service - Slim and JWT
Jwt with flask slide deck - alan swenson
iMasters Intercon 2016 - Identity within Microservices
InterCon 2016 - Segurança de identidade digital levando em consideração uma a...
Towards Interoperability between W3C Web of Things and NGSI-LD
Introduction to SAML & OIDC
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
Building IAM for OpenStack
The OpenID Connect Protocol
5 easy steps to understanding json web tokens (jwt)
2016 pycontw web api authentication
Securing RESTful API
Apache Knox Gateway "Single Sign On" expands the reach of the Enterprise Users
JsonWebTokens ppt - explains JWT, JWS , JWE Tokens
Scalable Reliable Secure REST
Ssl https
Ad

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
RMMM.pdf make it easy to upload and study
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Presentation on HIE in infants and its manifestations
PPTX
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Supply Chain Operations Speaking Notes -ICLT Program
RMMM.pdf make it easy to upload and study
O7-L3 Supply Chain Operations - ICLT Program
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
Module 4: Burden of Disease Tutorial Slides S2 2025
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Presentation on HIE in infants and its manifestations
Pharma ospi slides which help in ospi learning

Json Web Token - JWT

  • 2. Overview What is JSON Web Token? JSON Web Tokens Uses ● Authorization ● Information Exchange How do JSON Web Tokens work
  • 3. What is 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.
  • 4. JSON Web Tokens Uses Authorization ● 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. Information Exchange ● JSON Web Tokens are a good way of securely transmitting information between parties
  • 5. Why should we use JSON Web Tokens? ● Security - Securely transmitting information between parties using public/private key pairs ● Ease - Ease of client-side processing of the JSON Web token on multiple platforms, especially mobile. ● Compact -Because of its size, it can be sent through an URL, POST parameter, or inside an HTTP header. Additionally, due to its size its transmission is fast. ● Self-Contained - The payload contains all the required information about the user, to avoid querying the database more than once.
  • 6. How do JSON Web Tokens work?
  • 7. JWT format header.payload.signature ● Header - consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC SHA256 or RSA. For example: { "alg": "HS256", "typ": "JWT" }
  • 8. JWT format header.payload.signature ● Payload- Contains the claims. Claims are statements about an entity (typically, the user) and additional data. There are three types of claims: registered, public, and private claims. For example: { "user_id": "4" }
  • 9. JWT format header.payload.signature ● 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. For example (HMAC SHA256 algorithm): HMACSHA256( base64UrlEncode(header) + "." + base64UrlEncode(payload), secret)
  • 10. JWT format Authentication Server User Sign In ([username/password]) User Authenticated, JWT Created and return to USER 1 2 {header.payload.signature } {JWT} User Application Server User passes [JWT] When making API Calls3 Application verifies and processes API Call4
  • 11. JWT to verify the authenticity of a user ● User first signs into the authentication server using the authentication server’s login system (e.g. username and password, Facebook login, Google login, Twitter etc). ● The authentication server then creates the JWT and sends it to the user. ● When the user makes API calls to the application, the user passes the JWT along with the API call. ● In this setup, the application server would be configured to verify that the incoming JWT are created by the authentication server ● When the user makes API calls with the attached JWT, the application can use the JWT to verify that the API call is coming from an authenticated user.
  • 12. Conclusion Definitely having reliable way to authenticate user is the first thing on the list and using JWT Authentication as an best authentication method.