SlideShare a Scribd company logo
JSON WEB TOKEN
Ivan Rosolen
Graduado em Sistemas de Informação
Pós-graduado em Gerência de Projetos
Desenvolvedor a 15+ anos
Autor de vários PHPT (testes para o PHP)
Entusiasta de novas tecnologias
Head of Innovation @ Arizona
CTO @ Mokation
@ivanrosolen
Authentication
- Form Request Post/Get
- OAuth
- Key/Hash
- Credenciais em plain text
- Session Cookies
- Data is stored in plain text on the server
- Filesystem read/write requests
- Distributed/clustered applications
- Redis/Sticky sessions
API
- Stateless authentication (simplifies horizontal scaling)
- Prevent (mitigate) Cross-Site Request Forgery (CSRF)
attacks.
- Security (https)
- Authorization: Bearer
- 401 unauthorized / 403 forbidden
JOSE
- JWT
- JWS
- JWA
- JWK
- JWE
JSON Object Signing and Encryption
Advantages
- JSON Web Tokens work across different programming languages
- JWTs are self-contained
- JWTs can be passed around easily and secure
- Better control like “one time token” to forgot password, confirm
user, request rates, access, etc.
- One token to rule them all (Stateless)
Anatomy
header.claims.signature
Header
{
"typ": "JWT",
"alg": "HS256"
}
Claims
- iss: The issuer of the token
- sub: The subject of the token
- aud: The audience of the token
- exp: This will probably be the registered claim most often used. This will define the expiration
in NumericDate value. The expiration MUST be after the current date/time.
- nbf: Defines the time before which the JWT MUST NOT be accepted for processing
- iat: The time the JWT was issued. Can be used to determine the age of the JWT
- jti: Unique identifier for the JWT. Can be used to prevent the JWT from being replayed. This is
helpful for a one time use token.
http://www.slideshare.net/lcobucci/jwt-to-authentication-and-beyond
Payload / Claims
{
"iss": "ivanrosolen.com",
"exp": 1300819380,
"name": "Ivan Rosolen",
"admin": true
}
JWT
eyJ0eXAiOiAiSldUIiwiYWxnIjogIkhTMjU2In0=
.
eyJpc3MiOiAiaXZhbnJvc29sZW4uY29tIiwiZXhwIjogMTMwM
DgxOTM4MCwibmFtZSI6ICJJdmFuIFJvc29sZW4iLCJhZG1pbiI
6IHRydWV9
.
JWS
- header
- claims
payload
base64(header) . base64(claims)
JWA
- secret (hmac sha256, rsa256 ....)
- encrypt payload with key ‘Xuplau’
Signature
var encodedString = base64UrlEncode(header) + "."
+ base64UrlEncode(payload);
HMACSHA256(encodedString, 'Xuplau');
JWT
eyJ0eXAiOiAiSldUIiwiYWxnIjogIkhTMjU2In0=
.
eyJpc3MiOiAiaXZhbnJvc29sZW4uY29tIiwiZXhwIjogMTMwM
DgxOTM4MCwibmFtZSI6ICJJdmFuIFJvc29sZW4iLCJhZG1pbiI
6IHRydWV9
.
M2FjZTM0M2ZiNjhhMzBiOWNiYTkxN2U1Zjk4YjUxOWYzMT
Y3NGZlMmU4MTIzYjU1NTRkMjNlNjYzOTkyZGU2Nw==
Code
JSON Web Tokens
JSON Web Tokens
Github
- Session
- JWT
- JOSE
Refs
Github
https://github.com/ivanrosolen/crud-demo
JWT
https://github.com/dwyl/learn-json-web-tokens
http://jwt.io
https://developer.atlassian.com/static/connect/docs/latest/concepts/understanding-jwt.html
http://stackoverflow.com/questions/20588467/how-to-do-stateless-session-less-cookie-less-authentication
Talks
http://www.slideshare.net/erickt86/secureapi
http://www.slideshare.net/lcobucci/jwt-to-authentication-and-beyond
Luís Otávio Cobucci Oblonczyk
https://github.com/lcobucci/jwt
https://github.com/Ocramius/PSR7Session
????
OBRIGADO!
Visite phpsp.org.br

More Related Content

PPTX
Json Web Token - JWT
PDF
Json web token
PPTX
Understanding JWT Exploitation
PPTX
Pentesting jwt
PDF
Modern API Security with JSON Web Tokens
PDF
JSON WEB TOKEN
PDF
Using JSON Web Tokens for REST Authentication
PDF
JSON Web Token
Json Web Token - JWT
Json web token
Understanding JWT Exploitation
Pentesting jwt
Modern API Security with JSON Web Tokens
JSON WEB TOKEN
Using JSON Web Tokens for REST Authentication
JSON Web Token

What's hot (20)

PDF
Jwt Security
PPTX
Rest API Security
ODP
OAuth2 - Introduction
PDF
OAuth 2.0
PDF
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
PDF
Introduction to JWT and How to integrate with Spring Security
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
PPTX
Token Authentication in ASP.NET Core
PPTX
Rest API Security - A quick understanding of Rest API Security
PDF
Rego Deep Dive
PDF
[OPD 2019] Attacking JWT tokens
PDF
Attacking and defending GraphQL applications: a hands-on approach
PPTX
OpenId Connect Protocol
PPT
OAuth 2.0 and OpenId Connect
PPTX
Blockchain Intro to Hyperledger Fabric
PPTX
An introduction to OAuth 2
PPT
Source Code Analysis with SAST
PPTX
GraphQL Security
PPTX
PPTX
Secure your app with keycloak
Jwt Security
Rest API Security
OAuth2 - Introduction
OAuth 2.0
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
Introduction to JWT and How to integrate with Spring Security
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Token Authentication in ASP.NET Core
Rest API Security - A quick understanding of Rest API Security
Rego Deep Dive
[OPD 2019] Attacking JWT tokens
Attacking and defending GraphQL applications: a hands-on approach
OpenId Connect Protocol
OAuth 2.0 and OpenId Connect
Blockchain Intro to Hyperledger Fabric
An introduction to OAuth 2
Source Code Analysis with SAST
GraphQL Security
Secure your app with keycloak
Ad

Viewers also liked (20)

PPTX
JOSE Can You See...
PPTX
I Left My JWT in San JOSE
PDF
JSON Web Tokens (JWT)
PDF
JWT - To authentication and beyond!
PDF
Authentication: Cookies vs JWTs and why you’re doing it wrong
PPTX
Brokerage focus group 15 june 2015
DOCX
Clasa a iii
PDF
LAND ENCROACHED BY INFOSYS, OTHER COMPANIES IN THINDLU LAKE RECOVERED
PDF
Wharton Single Family Office benchmark
PDF
FOLLOW LAW, LET SCHOOLS TEACH IN ENGLISH: HIGH COURT
PDF
The order of title sequences
PPTX
Bordes divergentes
PDF
CompUSA Employment Marketing Ads
PPTX
Diplo. seguridad ciudadana (panamá)
PPTX
TV Cultura - Produção
PDF
Homedata Reco
DOC
Computadora pcel l430
PPTX
Eval 1 continued
PDF
Deu na Telha | Logotipo e Identidade Visual
PPTX
www.AulasEnsinoMedio.com.br - Física - Lentes Esféricas
JOSE Can You See...
I Left My JWT in San JOSE
JSON Web Tokens (JWT)
JWT - To authentication and beyond!
Authentication: Cookies vs JWTs and why you’re doing it wrong
Brokerage focus group 15 june 2015
Clasa a iii
LAND ENCROACHED BY INFOSYS, OTHER COMPANIES IN THINDLU LAKE RECOVERED
Wharton Single Family Office benchmark
FOLLOW LAW, LET SCHOOLS TEACH IN ENGLISH: HIGH COURT
The order of title sequences
Bordes divergentes
CompUSA Employment Marketing Ads
Diplo. seguridad ciudadana (panamá)
TV Cultura - Produção
Homedata Reco
Computadora pcel l430
Eval 1 continued
Deu na Telha | Logotipo e Identidade Visual
www.AulasEnsinoMedio.com.br - Física - Lentes Esféricas
Ad

Similar to JSON Web Tokens (20)

PDF
Autenticação com Json Web Token (JWT)
PDF
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PPTX
JWT_Presentation to show how jwt is better then session based authorization
PPTX
Uniface Lectures Webinar - Application & Infrastructure Security - JSON Web T...
PDF
What are JSON Web Tokens and Why Should I Care?
PPTX
Json web tokens
PPTX
JsonWebTokens ppt - explains JWT, JWS , JWE Tokens
PDF
Json web token api authorization
PDF
The Hacker's Guide to JWT Security
PDF
Jwt with flask slide deck - alan swenson
PDF
JWT stands for JSON Web Token. It's a compact, URL-safe means of representing...
PPTX
Micro Web Service - Slim and JWT
PPTX
PDF
JSON Web Tokens Will Improve Your Life
PDF
5 easy steps to understanding json web tokens (jwt)
PDF
Landscape
PDF
Landscape
PDF
JWT! JWT! Let it all out!
PPTX
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Autenticação com Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
JWT_Presentation to show how jwt is better then session based authorization
Uniface Lectures Webinar - Application & Infrastructure Security - JSON Web T...
What are JSON Web Tokens and Why Should I Care?
Json web tokens
JsonWebTokens ppt - explains JWT, JWS , JWE Tokens
Json web token api authorization
The Hacker's Guide to JWT Security
Jwt with flask slide deck - alan swenson
JWT stands for JSON Web Token. It's a compact, URL-safe means of representing...
Micro Web Service - Slim and JWT
JSON Web Tokens Will Improve Your Life
5 easy steps to understanding json web tokens (jwt)
Landscape
Landscape
JWT! JWT! Let it all out!
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

More from Ivan Rosolen (17)

PDF
15 mandamentos de um bom programador
PDF
Utilizando Filas com PHP
PDF
Filas com php
PDF
Boas Práticas com PHP
PDF
Mercado de Tecnologia
PPTX
Deploy automatizado de Aplicações no Jelastic
PDF
Tecnologias e Inovação
PDF
Rest Beer v2
PPTX
Jelastic
PPTX
Aws video creator
PPTX
Cassandra 7 masters
PDF
Quando o planejamento da infraestrutura leva ao sucesso
PDF
Case: PHP como Base de Digital Asset Management – arizona.flow
PDF
Php e Cassandra
PDF
Criando APIs usando o micro-framework Respect
PDF
KEY
CakePHP e o desenvolvimento rápido
15 mandamentos de um bom programador
Utilizando Filas com PHP
Filas com php
Boas Práticas com PHP
Mercado de Tecnologia
Deploy automatizado de Aplicações no Jelastic
Tecnologias e Inovação
Rest Beer v2
Jelastic
Aws video creator
Cassandra 7 masters
Quando o planejamento da infraestrutura leva ao sucesso
Case: PHP como Base de Digital Asset Management – arizona.flow
Php e Cassandra
Criando APIs usando o micro-framework Respect
CakePHP e o desenvolvimento rápido

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Modernizing your data center with Dell and AMD
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Modernizing your data center with Dell and AMD
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation_ Review paper, used for researhc scholars
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Diabetes mellitus diagnosis method based random forest with bat algorithm
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding

JSON Web Tokens