SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
… dank JWT
Token statt Cookies
Markus Schlichting
Senior Software Engineer
Basel, Schweiz
Hackergarten Basel
markus.schlichting@canoo.com
@madmas
Warum?
• REST APIs
• Single Page Applications
• Microservices
Sessions & Cookies
Credentials validieren,
Session erzeugen
Session Cookie
Session
Store
Session validieren,
Zugriff kontrollieren
http://app.canoo.com http://app.canoo.com
Sessions & Cookies
Loadbalancing benötigt geteilten Sessionpool
Services werden gekoppelt
Cross Domain Authentifizierung: CORS
CSRF Verwundbarkeit
Andere Clients ausser Browser?
JSON Web Tokens are an open, industry
standard method for representing claims
securely between two parties.
(RFC 7519)
JSON Web Token
The suggested pronunciation of JWT

is the same as the English word "jot".
JSON Web Token
basierend auf anderen JSON-Standards:
JWS (JSON Web Signature)
JWE (JSON Web Encryption)
!!!
Bibliotheken für..
JWT in Action
Credentials validieren,
Token erzeugen
Token speichern
Token validieren,
Zugriff kontrollieren
http://app.canoo.com http://api.canoo.com
JWT - inside
jwt.io
JWT - inside: Payload
Registered Claims IANA JSON WebToken Register
Public Claims öffentl. lesbare Claims: Eindeutigkeit!
Private Claims private Claims: Freie Wahl!
JWT - in practice
Demo!
immer verschlüsselt kommunizieren ( HTTPS! )
URL Token vermeiden

https://yourpage.de/service/action?token=jwt.goes.here
Token Handling: Invalidation, Reset
JWT Security Aspekte
JWT Überblick
basiert auf JSON
einfach zu nutzen, einfach zu implementieren
symmetrische und asymmetrische Crypto
reduziert Abhängigkeiten
Basisprinzip von REST: State transfer
Cookies nicht obsolet, Token bieten jedoch viele Vorteile
JWT für Skalierbarkeit und Flexibilität
Cross Plattform
Cookies oder Token? 

Anforderungen und Implikationen abwägen!
Zusammenfassung
Demo Sources und Slides:

https://github.com/madmas/TokenVsCookies

Weitere ähnliche Inhalte

Andere mochten auch

Moving the Needle with Social Media
Moving the Needle with Social MediaMoving the Needle with Social Media
Moving the Needle with Social MediaStrongView
 
Blue moon - abstract acrylic painting
Blue moon - abstract acrylic paintingBlue moon - abstract acrylic painting
Blue moon - abstract acrylic paintingTataro
 
如何讓顧客離不開你
如何讓顧客離不開你如何讓顧客離不開你
如何讓顧客離不開你kkjjkevin03
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orcTomas Doran
 
85 Gnarly Local SEO Tips for Auto Dealers
85 Gnarly Local SEO Tips for Auto Dealers85 Gnarly Local SEO Tips for Auto Dealers
85 Gnarly Local SEO Tips for Auto DealersGreg Gifford
 
Emailer Generic letter
Emailer Generic letterEmailer Generic letter
Emailer Generic letterShane Thompson
 
Shodh yatra report compressed copy
Shodh yatra report compressed copyShodh yatra report compressed copy
Shodh yatra report compressed copyMarianne Esders
 
Data Defeats Truman – SXSW Panelpicker Pitch
Data Defeats Truman – SXSW Panelpicker PitchData Defeats Truman – SXSW Panelpicker Pitch
Data Defeats Truman – SXSW Panelpicker PitchKyle J. Britt
 
Mattawa, Ontario, Canada, 1970
Mattawa, Ontario, Canada, 1970Mattawa, Ontario, Canada, 1970
Mattawa, Ontario, Canada, 1970Joe Carter
 
UNISA InfoLit Story 24 May 2016
UNISA InfoLit Story 24 May 2016UNISA InfoLit Story 24 May 2016
UNISA InfoLit Story 24 May 2016HELIGLIASA
 

Andere mochten auch (12)

Moving the Needle with Social Media
Moving the Needle with Social MediaMoving the Needle with Social Media
Moving the Needle with Social Media
 
Blue moon - abstract acrylic painting
Blue moon - abstract acrylic paintingBlue moon - abstract acrylic painting
Blue moon - abstract acrylic painting
 
如何讓顧客離不開你
如何讓顧客離不開你如何讓顧客離不開你
如何讓顧客離不開你
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orc
 
85 Gnarly Local SEO Tips for Auto Dealers
85 Gnarly Local SEO Tips for Auto Dealers85 Gnarly Local SEO Tips for Auto Dealers
85 Gnarly Local SEO Tips for Auto Dealers
 
Emailer Generic letter
Emailer Generic letterEmailer Generic letter
Emailer Generic letter
 
Shodh yatra report compressed copy
Shodh yatra report compressed copyShodh yatra report compressed copy
Shodh yatra report compressed copy
 
Data Defeats Truman – SXSW Panelpicker Pitch
Data Defeats Truman – SXSW Panelpicker PitchData Defeats Truman – SXSW Panelpicker Pitch
Data Defeats Truman – SXSW Panelpicker Pitch
 
Productos químicos de alta calidad Ronald Vera
Productos químicos de alta calidad Ronald Vera Productos químicos de alta calidad Ronald Vera
Productos químicos de alta calidad Ronald Vera
 
Jardin de julio.
Jardin de julio.Jardin de julio.
Jardin de julio.
 
Mattawa, Ontario, Canada, 1970
Mattawa, Ontario, Canada, 1970Mattawa, Ontario, Canada, 1970
Mattawa, Ontario, Canada, 1970
 
UNISA InfoLit Story 24 May 2016
UNISA InfoLit Story 24 May 2016UNISA InfoLit Story 24 May 2016
UNISA InfoLit Story 24 May 2016
 

Ähnlich wie Token statt Cookies dank JWT - #ETKA16

Token statt Cookies dank JWT (Java Land 2016)
Token statt Cookies dank JWT (Java Land 2016)Token statt Cookies dank JWT (Java Land 2016)
Token statt Cookies dank JWT (Java Land 2016)Markus Schlichting
 
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...new Html5 features and browser compatibility, Stand der Standardisierung, Übe...
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...Sinan Akalın
 
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdfDACHNUG50 Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdfDNUG e.V.
 
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdfDACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdfDNUG e.V.
 
Ivory Soa Suite
Ivory Soa SuiteIvory Soa Suite
Ivory Soa SuitePredrag61
 
Top 10 Internet Trends 2000
Top 10 Internet Trends 2000Top 10 Internet Trends 2000
Top 10 Internet Trends 2000Jürg Stuker
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?adesso AG
 
Api Platform: the ultimate API Platform
Api Platform: the ultimate API PlatformApi Platform: the ultimate API Platform
Api Platform: the ultimate API PlatformStefan Adolf
 
Ist GraphQL das bessere REST
Ist GraphQL das bessere RESTIst GraphQL das bessere REST
Ist GraphQL das bessere RESTMartin Abraham
 
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDISchlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDIadesso AG
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestBastian Feder
 
Top 10 Internet Trends 2006
Top 10 Internet Trends 2006Top 10 Internet Trends 2006
Top 10 Internet Trends 2006Jürg Stuker
 
Back to the Frontend – aber nun mit Microservices
Back to the Frontend – aber nun mit MicroservicesBack to the Frontend – aber nun mit Microservices
Back to the Frontend – aber nun mit MicroservicesAndré Fleischer
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile ServicesJan Hentschel
 
Basta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudBasta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudMarc Müller
 
Meet Magento - High performance magento
Meet Magento - High performance magentoMeet Magento - High performance magento
Meet Magento - High performance magentoAOE
 
OWASP Top 10 : Scanning JSF
OWASP Top 10 : Scanning JSFOWASP Top 10 : Scanning JSF
OWASP Top 10 : Scanning JSFadesso AG
 

Ähnlich wie Token statt Cookies dank JWT - #ETKA16 (20)

Token statt Cookies dank JWT (Java Land 2016)
Token statt Cookies dank JWT (Java Land 2016)Token statt Cookies dank JWT (Java Land 2016)
Token statt Cookies dank JWT (Java Land 2016)
 
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...new Html5 features and browser compatibility, Stand der Standardisierung, Übe...
new Html5 features and browser compatibility, Stand der Standardisierung, Übe...
 
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdfDACHNUG50 Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Domino REST API - Konzepte und Hintergruende.pdf
 
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdfDACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdf
DACHNUG50 Die Domino REST API - Konzepte und Hintergruende.pdf
 
Ivory Soa Suite
Ivory Soa SuiteIvory Soa Suite
Ivory Soa Suite
 
Top 10 Internet Trends 2000
Top 10 Internet Trends 2000Top 10 Internet Trends 2000
Top 10 Internet Trends 2000
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
 
Api Platform: the ultimate API Platform
Api Platform: the ultimate API PlatformApi Platform: the ultimate API Platform
Api Platform: the ultimate API Platform
 
GWT
GWTGWT
GWT
 
Ist GraphQL das bessere REST
Ist GraphQL das bessere RESTIst GraphQL das bessere REST
Ist GraphQL das bessere REST
 
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDISchlanke Webarchitekturen nicht nur mit JSF 2 und CDI
Schlanke Webarchitekturen nicht nur mit JSF 2 und CDI
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google Suggest
 
Top 10 Internet Trends 2006
Top 10 Internet Trends 2006Top 10 Internet Trends 2006
Top 10 Internet Trends 2006
 
Web-API Design in Java
Web-API Design in JavaWeb-API Design in Java
Web-API Design in Java
 
Back to the Frontend – aber nun mit Microservices
Back to the Frontend – aber nun mit MicroservicesBack to the Frontend – aber nun mit Microservices
Back to the Frontend – aber nun mit Microservices
 
Windows Azure Mobile Services
Windows Azure Mobile ServicesWindows Azure Mobile Services
Windows Azure Mobile Services
 
Basta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudBasta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der Cloud
 
Ajax, Comet & Co.
Ajax, Comet & Co.Ajax, Comet & Co.
Ajax, Comet & Co.
 
Meet Magento - High performance magento
Meet Magento - High performance magentoMeet Magento - High performance magento
Meet Magento - High performance magento
 
OWASP Top 10 : Scanning JSF
OWASP Top 10 : Scanning JSFOWASP Top 10 : Scanning JSF
OWASP Top 10 : Scanning JSF
 

Token statt Cookies dank JWT - #ETKA16

  • 1. … dank JWT Token statt Cookies
  • 2. Markus Schlichting Senior Software Engineer Basel, Schweiz Hackergarten Basel markus.schlichting@canoo.com @madmas
  • 3. Warum? • REST APIs • Single Page Applications • Microservices
  • 4. Sessions & Cookies Credentials validieren, Session erzeugen Session Cookie Session Store Session validieren, Zugriff kontrollieren http://app.canoo.com http://app.canoo.com
  • 5. Sessions & Cookies Loadbalancing benötigt geteilten Sessionpool Services werden gekoppelt Cross Domain Authentifizierung: CORS CSRF Verwundbarkeit Andere Clients ausser Browser?
  • 6. JSON Web Tokens are an open, industry standard method for representing claims securely between two parties. (RFC 7519) JSON Web Token The suggested pronunciation of JWT
 is the same as the English word "jot".
  • 7. JSON Web Token basierend auf anderen JSON-Standards: JWS (JSON Web Signature) JWE (JSON Web Encryption) !!! Bibliotheken für..
  • 8. JWT in Action Credentials validieren, Token erzeugen Token speichern Token validieren, Zugriff kontrollieren http://app.canoo.com http://api.canoo.com
  • 10. JWT - inside: Payload Registered Claims IANA JSON WebToken Register Public Claims öffentl. lesbare Claims: Eindeutigkeit! Private Claims private Claims: Freie Wahl!
  • 11. JWT - in practice Demo!
  • 12. immer verschlüsselt kommunizieren ( HTTPS! ) URL Token vermeiden
 https://yourpage.de/service/action?token=jwt.goes.here Token Handling: Invalidation, Reset JWT Security Aspekte
  • 13. JWT Überblick basiert auf JSON einfach zu nutzen, einfach zu implementieren symmetrische und asymmetrische Crypto reduziert Abhängigkeiten Basisprinzip von REST: State transfer
  • 14. Cookies nicht obsolet, Token bieten jedoch viele Vorteile JWT für Skalierbarkeit und Flexibilität Cross Plattform Cookies oder Token? 
 Anforderungen und Implikationen abwägen! Zusammenfassung
  • 15. Demo Sources und Slides:
 https://github.com/madmas/TokenVsCookies