SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
JWTs
More than you think
History
• September 2011 - JOSE Working Group
founded
• April 2014 - RFC7165 - Use Cases and
Requirements for JSON Object Signing and
Encryption (JOSE)
• May 2015 - RFC7515(JWS), 7516(JWE),
7517(JWK), 7518(JWA) and 7519(JWT)
Terminology
• Base64URL - Base 64 encoding, making use of
only URL safe characters.
• Symmetric Encryption - Encryption that uses a
single key that is shared between the two
parties.
• Asymmetric Encryption - Encryption that uses
public private key pairs.
JWT or Not?
{

alg: RS256,

typ: JWT

},

{

iss: "Chris Larsen",

sub: 'JWT',

aud: 'Silicon Halton',

iat: Time.now

}
Is this a
JWT?
JWT or Not?
{

alg: RS256,

typ: JWT

},

{

iss: "Chris Larsen",

sub: 'JWT',

aud: 'Silicon Halton',

iat: Time.now

}
Yes and
No.
It’s a
type of
JWT
called a
JWS
Terminology - More
• JWS - JSON Web Signature. A JWT that includes
a signature formed by encrypting the header
and payload. These are encrypted with either
the sender’s symmetric key or private key.
• JWE - JSON Web Encryption. A JWT that
encrypts the payload for transmission. The
payload is encrypted using either a symmetric
key, or the receiver’s public key.
JWS vs JWE
JWS
• Transmits claims with
encrypted signature to ensure
authenticity.
• Compact serialization
contains 3 components.
• Example:
JWE
• Transmits message in
encrypted form to ensure
privacy.
• Compact serialization
contains 5 components.
• Example:
JWS - Process
1. Encode JWS Protected Header as BASE64URL(UTF8(JWS
Protected Header))
2. Encode JWS Payload as BASE64URL(UTF8(JWS Payload))
3. Encrypt ASCII(BASE64URL(UTF8(JWS Protected Header))
|| '.' || BASE64URL(JWS Payload)) using the algorithm
specified in the header and the key.
4. Concatenate these values in the order
Header.Payload.Signature.
5. This provides the URL safe JWS Compact Serialization
JWS - Summary
JWE - Process
1. Encode JWE Protected header as BASE64URL(UTF8(JWS Protected Header))
2. Generate a random Content Encryption Key(CEK)
3. Encrypt the CEK with the recipient's public key using the algorithm specified by “alg” in the
header
4. Base64url-encode the JWE Encrypted Key
5. Generate a random Initialization Vector, and Base64URL encode it
6. Generate the Additional Authenticated Data as a Base64URL encoding of the Protected
Header
7. Encrypt the plaintext with the algorithm specified by “enc” in the header, using the CEK as the
encryption key, the Initialization Vector, and the Additional Authenticated Data value
8. Concatenate these values in the order
ProtectedHeader.EncryptedKey.InitializationVector.Ciphertext.AuthenticationTag
9. This provides the URL safe JWE Compact Serialization
JWE - Summary
Libraries
• .NET - 3

• C - 2

• C++ - 3

• Elixir - 3

• Go - 11

• Java - 6

• JavaScript - 3

• Perl - 1

• PHP - 10

• Python - 4

• Ruby - 4

• Scala - 4

• Swift - 4

According to JWT.io
Additional Resources
• https://tools.ietf.org/html/rfc7519
• https://tools.ietf.org/html/rfc7165
• https://datatracker.ietf.org/wg/jose/documents/
Website: www.christianlarsen.ca
Blog: hclarsenblog.wordpress.com
Twitter: @thechrislarsen

Mais conteúdo relacionado

Semelhante a A Primer on JSON Web Tokens

The JSON-based Identity Protocol Suite
The JSON-based Identity Protocol SuiteThe JSON-based Identity Protocol Suite
The JSON-based Identity Protocol SuiteTwobo Technologies
 
Overview of JSON Object Signing and Encryption
Overview of JSON Object Signing and EncryptionOverview of JSON Object Signing and Encryption
Overview of JSON Object Signing and EncryptionMasaru Kurahayashi
 
Introduction to the Emerging JSON-Based Identity and Security Protocols
Introduction to the Emerging JSON-Based Identity and Security ProtocolsIntroduction to the Emerging JSON-Based Identity and Security Protocols
Introduction to the Emerging JSON-Based Identity and Security ProtocolsBrian Campbell
 
CIS14: I Left My JWT in San JOSE
CIS14: I Left My JWT in San JOSECIS14: I Left My JWT in San JOSE
CIS14: I Left My JWT in San JOSECloudIDSummit
 
[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokensOWASP
 
JWT: jku x5u
JWT: jku x5uJWT: jku x5u
JWT: jku x5usnyff
 
Data Con LA 2022 - MySQL, JSON & You: Perfect Together
Data Con LA 2022 - MySQL, JSON & You: Perfect TogetherData Con LA 2022 - MySQL, JSON & You: Perfect Together
Data Con LA 2022 - MySQL, JSON & You: Perfect TogetherData Con LA
 
The NoSQL Way in Postgres
The NoSQL Way in PostgresThe NoSQL Way in Postgres
The NoSQL Way in PostgresEDB
 
Ts archiving
Ts   archivingTs   archiving
Ts archivingConfiz
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetricphanleson
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
Con Foo 2017 - Don't Loose Sleep - Secure Your REST
Con Foo 2017 - Don't Loose Sleep - Secure Your RESTCon Foo 2017 - Don't Loose Sleep - Secure Your REST
Con Foo 2017 - Don't Loose Sleep - Secure Your RESTAdam Englander
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearchErhwen Kuo
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017Adam Englander
 
JSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cJSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cstewashton
 

Semelhante a A Primer on JSON Web Tokens (20)

The JSON-based Identity Protocol Suite
The JSON-based Identity Protocol SuiteThe JSON-based Identity Protocol Suite
The JSON-based Identity Protocol Suite
 
Overview of JSON Object Signing and Encryption
Overview of JSON Object Signing and EncryptionOverview of JSON Object Signing and Encryption
Overview of JSON Object Signing and Encryption
 
Introduction to the Emerging JSON-Based Identity and Security Protocols
Introduction to the Emerging JSON-Based Identity and Security ProtocolsIntroduction to the Emerging JSON-Based Identity and Security Protocols
Introduction to the Emerging JSON-Based Identity and Security Protocols
 
JWTs and JOSE in a flash
JWTs and JOSE in a flashJWTs and JOSE in a flash
JWTs and JOSE in a flash
 
CIS14: I Left My JWT in San JOSE
CIS14: I Left My JWT in San JOSECIS14: I Left My JWT in San JOSE
CIS14: I Left My JWT in San JOSE
 
JOSE Can You See...
JOSE Can You See...JOSE Can You See...
JOSE Can You See...
 
[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens[OPD 2019] Attacking JWT tokens
[OPD 2019] Attacking JWT tokens
 
JWT: jku x5u
JWT: jku x5uJWT: jku x5u
JWT: jku x5u
 
Data Con LA 2022 - MySQL, JSON & You: Perfect Together
Data Con LA 2022 - MySQL, JSON & You: Perfect TogetherData Con LA 2022 - MySQL, JSON & You: Perfect Together
Data Con LA 2022 - MySQL, JSON & You: Perfect Together
 
The NoSQL Way in Postgres
The NoSQL Way in PostgresThe NoSQL Way in Postgres
The NoSQL Way in Postgres
 
Ts archiving
Ts   archivingTs   archiving
Ts archiving
 
No sql way_in_pg
No sql way_in_pgNo sql way_in_pg
No sql way_in_pg
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
ERRest and Dojo
ERRest and DojoERRest and Dojo
ERRest and Dojo
 
Con Foo 2017 - Don't Loose Sleep - Secure Your REST
Con Foo 2017 - Don't Loose Sleep - Secure Your RESTCon Foo 2017 - Don't Loose Sleep - Secure Your REST
Con Foo 2017 - Don't Loose Sleep - Secure Your REST
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearch
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
 
JSON in Oracle 18c and 19c
JSON in Oracle 18c and 19cJSON in Oracle 18c and 19c
JSON in Oracle 18c and 19c
 

Mais de Chris Herbert

Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM Canada
Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM CanadaAdvanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM Canada
Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM CanadaChris Herbert
 
Structuring your business for growth
Structuring your business for growthStructuring your business for growth
Structuring your business for growthChris Herbert
 
Build Your StartUp To Sell
Build Your StartUp To SellBuild Your StartUp To Sell
Build Your StartUp To SellChris Herbert
 
Tu20 pitch yourself workshop and speed pitching session
Tu20 pitch yourself workshop and speed pitching sessionTu20 pitch yourself workshop and speed pitching session
Tu20 pitch yourself workshop and speed pitching sessionChris Herbert
 
Case study, Linkedin custom groups, Philips
Case study, Linkedin custom groups, PhilipsCase study, Linkedin custom groups, Philips
Case study, Linkedin custom groups, PhilipsChris Herbert
 
The last 50, canadian election 2011
The last 50, canadian election 2011The last 50, canadian election 2011
The last 50, canadian election 2011Chris Herbert
 
Mi6 chart toppers, March 2011
Mi6 chart toppers, March 2011Mi6 chart toppers, March 2011
Mi6 chart toppers, March 2011Chris Herbert
 
Mi6 chart toppers, Feb 2011
Mi6 chart toppers, Feb 2011Mi6 chart toppers, Feb 2011
Mi6 chart toppers, Feb 2011Chris Herbert
 
The Mi6 chart toppers, oct 2010
The Mi6 chart toppers, oct 2010The Mi6 chart toppers, oct 2010
The Mi6 chart toppers, oct 2010Chris Herbert
 
The Mi6 chart toppers, sep 2010
The Mi6 chart toppers, sep 2010The Mi6 chart toppers, sep 2010
The Mi6 chart toppers, sep 2010Chris Herbert
 
The mi6 chart toppers, aug 2010
The mi6 chart toppers, aug 2010The mi6 chart toppers, aug 2010
The mi6 chart toppers, aug 2010Chris Herbert
 
Inside the Mind of The B2B Tech Buyer
Inside the Mind of The B2B Tech BuyerInside the Mind of The B2B Tech Buyer
Inside the Mind of The B2B Tech BuyerChris Herbert
 
Cisco iPrize Competion, HAN Idea presentation
Cisco iPrize Competion, HAN Idea presentationCisco iPrize Competion, HAN Idea presentation
Cisco iPrize Competion, HAN Idea presentationChris Herbert
 
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)Chris Herbert
 

Mais de Chris Herbert (15)

IoT and LoRaWAN
IoT and LoRaWANIoT and LoRaWAN
IoT and LoRaWAN
 
Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM Canada
Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM CanadaAdvanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM Canada
Advanced Manufacturing Supercluster meeting with Jayson Myers, CEO of NGM Canada
 
Structuring your business for growth
Structuring your business for growthStructuring your business for growth
Structuring your business for growth
 
Build Your StartUp To Sell
Build Your StartUp To SellBuild Your StartUp To Sell
Build Your StartUp To Sell
 
Tu20 pitch yourself workshop and speed pitching session
Tu20 pitch yourself workshop and speed pitching sessionTu20 pitch yourself workshop and speed pitching session
Tu20 pitch yourself workshop and speed pitching session
 
Case study, Linkedin custom groups, Philips
Case study, Linkedin custom groups, PhilipsCase study, Linkedin custom groups, Philips
Case study, Linkedin custom groups, Philips
 
The last 50, canadian election 2011
The last 50, canadian election 2011The last 50, canadian election 2011
The last 50, canadian election 2011
 
Mi6 chart toppers, March 2011
Mi6 chart toppers, March 2011Mi6 chart toppers, March 2011
Mi6 chart toppers, March 2011
 
Mi6 chart toppers, Feb 2011
Mi6 chart toppers, Feb 2011Mi6 chart toppers, Feb 2011
Mi6 chart toppers, Feb 2011
 
The Mi6 chart toppers, oct 2010
The Mi6 chart toppers, oct 2010The Mi6 chart toppers, oct 2010
The Mi6 chart toppers, oct 2010
 
The Mi6 chart toppers, sep 2010
The Mi6 chart toppers, sep 2010The Mi6 chart toppers, sep 2010
The Mi6 chart toppers, sep 2010
 
The mi6 chart toppers, aug 2010
The mi6 chart toppers, aug 2010The mi6 chart toppers, aug 2010
The mi6 chart toppers, aug 2010
 
Inside the Mind of The B2B Tech Buyer
Inside the Mind of The B2B Tech BuyerInside the Mind of The B2B Tech Buyer
Inside the Mind of The B2B Tech Buyer
 
Cisco iPrize Competion, HAN Idea presentation
Cisco iPrize Competion, HAN Idea presentationCisco iPrize Competion, HAN Idea presentation
Cisco iPrize Competion, HAN Idea presentation
 
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)
Blog Briefing,Chris Herbert, B2bspecialist, Mar2009(Ppt2003)
 

Último

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Último (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

A Primer on JSON Web Tokens

  • 2. History • September 2011 - JOSE Working Group founded • April 2014 - RFC7165 - Use Cases and Requirements for JSON Object Signing and Encryption (JOSE) • May 2015 - RFC7515(JWS), 7516(JWE), 7517(JWK), 7518(JWA) and 7519(JWT)
  • 3. Terminology • Base64URL - Base 64 encoding, making use of only URL safe characters. • Symmetric Encryption - Encryption that uses a single key that is shared between the two parties. • Asymmetric Encryption - Encryption that uses public private key pairs.
  • 4. JWT or Not? { alg: RS256, typ: JWT }, { iss: "Chris Larsen", sub: 'JWT', aud: 'Silicon Halton', iat: Time.now } Is this a JWT?
  • 5. JWT or Not? { alg: RS256, typ: JWT }, { iss: "Chris Larsen", sub: 'JWT', aud: 'Silicon Halton', iat: Time.now } Yes and No. It’s a type of JWT called a JWS
  • 6. Terminology - More • JWS - JSON Web Signature. A JWT that includes a signature formed by encrypting the header and payload. These are encrypted with either the sender’s symmetric key or private key. • JWE - JSON Web Encryption. A JWT that encrypts the payload for transmission. The payload is encrypted using either a symmetric key, or the receiver’s public key.
  • 7. JWS vs JWE JWS • Transmits claims with encrypted signature to ensure authenticity. • Compact serialization contains 3 components. • Example: JWE • Transmits message in encrypted form to ensure privacy. • Compact serialization contains 5 components. • Example:
  • 8. JWS - Process 1. Encode JWS Protected Header as BASE64URL(UTF8(JWS Protected Header)) 2. Encode JWS Payload as BASE64URL(UTF8(JWS Payload)) 3. Encrypt ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || BASE64URL(JWS Payload)) using the algorithm specified in the header and the key. 4. Concatenate these values in the order Header.Payload.Signature. 5. This provides the URL safe JWS Compact Serialization
  • 10. JWE - Process 1. Encode JWE Protected header as BASE64URL(UTF8(JWS Protected Header)) 2. Generate a random Content Encryption Key(CEK) 3. Encrypt the CEK with the recipient's public key using the algorithm specified by “alg” in the header 4. Base64url-encode the JWE Encrypted Key 5. Generate a random Initialization Vector, and Base64URL encode it 6. Generate the Additional Authenticated Data as a Base64URL encoding of the Protected Header 7. Encrypt the plaintext with the algorithm specified by “enc” in the header, using the CEK as the encryption key, the Initialization Vector, and the Additional Authenticated Data value 8. Concatenate these values in the order ProtectedHeader.EncryptedKey.InitializationVector.Ciphertext.AuthenticationTag 9. This provides the URL safe JWE Compact Serialization
  • 12. Libraries • .NET - 3 • C - 2 • C++ - 3 • Elixir - 3 • Go - 11 • Java - 6 • JavaScript - 3 • Perl - 1 • PHP - 10 • Python - 4 • Ruby - 4 • Scala - 4 • Swift - 4 According to JWT.io
  • 13. Additional Resources • https://tools.ietf.org/html/rfc7519 • https://tools.ietf.org/html/rfc7165 • https://datatracker.ietf.org/wg/jose/documents/