SlideShare a Scribd company logo
1 of 73
Download to read offline
Stateless token-based 
authentication for pure front-end 
applications 
MADRID · NOV 21-22 · 2014 
Álvaro Sánchez-Mariscal 
Web Architect 
Daniel Ortega Segura 
Senior Grails Developer
About us - Álvaro Sánchez-Mariscal 
● Passionate Software Developer. 
● Worked at IBM BCS, BEA Systems and Sun 
Microsystems. 
● Founded Salenda and Escuela de Groovy. 
● Working now at as a Web Architect. 
● Living between Madrid and Gibraltar. 
MADRID · NOV 21-22 · 2014
About us - Daniel Ortega Segura 
MADRID · NOV 21-22 · 2014 
● Enthusiast guitarist 
● Rubik’s cubes freak 
● Senior Grails Developer at
MADRID · NOV 21-22 · 2014 
About us - 
● HTML5 games platform. 
● We provide game developers a Javascript SDK. 
● Server side logic and maths are handled by our 
industry certified game engines. 
● Seamless integration with several casinos. 
● Check out play.odobo.com and play for free!
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
Authentication in monolithic apps 
● Historically, authentication has always been a 
stateful service. 
● When moving to Single-Page Applications, 
and/or having mobile clients, it becomes an 
issue. 
● If you are build a REST and stateless API, your 
authentication should be that way too. 
MADRID · NOV 21-22 · 2014
Microservices by http://martinfowler.com/articles/microservices. 
html 
MADRID · NOV 21-22 · 2014
Microservices by http://martinfowler.com/articles/microservices. 
html 
MADRID · NOV 21-22 · 2014
Authentication and microservices 
● Authentication: to verify the identity of the 
user given the credentials received. 
● Authorization: to determine if the user should 
be granted access to a particular resource. 
● In a microservices context: 
○ Authentication can be a microservice itself. 
○ Authorization is a common functionality in all of them. 
MADRID · NOV 21-22 · 2014
Authentication and microservices 
Catalog DB 
Invoicing 
DB 
MADRID · NOV 21-22 · 2014 
Javascript front-end 
UI 
Mobile app 
Authentication 
Service 
Shopping cart 
Service 
Catalog 
Service 
Orders Service 
Shipping 
Service 
User 
repository 
Shipping 
partners 
Web 
Backend 
Mobile 
Backend
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Introducing OAuth 2.0 
An open protocol to allow secure authorization 
in a simple and standard method from web, 
mobile and desktop applications.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: roles 
Resource Owner: the person or the application 
that holds the data to be shared. 
Resource Server: the application that holds the 
protected resources. 
Authorization Server: the application that 
verifies the identity of the users. 
Client: the application that makes requests to 
the RS on behalf of the RO.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: roles 
Resource Owner: the person or the application 
that holds the data to be shared. 
Resource Server: the application that holds the 
protected resources. 
Authorization Server: the application that 
verifies the identity of the users. 
Client: the application that makes requests to 
the RS on behalf of the RO.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: roles 
Resource Owner: the person or the application 
that holds the data to be shared. 
Resource Server: the application that holds the 
protected resources. 
Authorization Server: the application that 
verifies the identity of the users. 
Client: the application that makes requests to 
the RS on behalf of the RO.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: roles 
Resource Owner: the person or the application 
that holds the data to be shared. 
Resource Server: the application that holds the 
protected resources. 
Authorization Server: the application that 
verifies the identity of the users. 
Client: the application that makes requests to 
the RS on behalf of the RO.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
I want to see a list of games
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Hey, backend, could you please give me a list of 
games?
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Sorry mate, this is a protected resource. You will 
need to present me an access token
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Hi Google, can I get an access token please? 
Backend is asking
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Sure thing sir. I just need to ask a few details to 
the user first
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Hi, could you please provide me your 
credentials? I need to verify your identity
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
That’s no problem at all. I am bob@gmail.com and 
my password is secret.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
The user is who claims to be. Here is your access 
token: qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Hi Backend, this is my token: 
qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Hi, I’ve been given qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa. 
Could you please tell me who it belongs to?
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Of course. That token is still valid and it belongs to 
bob@gmail.com.
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Everything is allright. This is the list of games. 
Enjoy!
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
Here you are the list of games.Thank you for your 
business and have a good day!
MADRID · NOV 21-22 · 2014 
OAuth 2.0: protocol flow 
OAuth 2.0 is a delegation protocol, as 
this guy has no idea about the 
credentials of this guy
MADRID · NOV 21-22 · 2014 
OAuth 2.0: grant types 
● Authorization code: for web server 
applications. 
● Implicit: for JS front-ends and mobile apps. 
● Resource Owner Password Credentials: for 
trusted clients. 
● Client credentials: for service authentication.
Authorization code grant 
● For server-based applications, where the 
client ID and secret are securely stored. 
● It’s a redirect flow, so it’s for web server apps. 
● The client (web server app) redirects the user 
to the authorization server to get a code. 
● Then, using the code and its client credentials 
MADRID · NOV 21-22 · 2014 
asks for an access token.
MADRID · NOV 21-22 · 2014 
Authorization code grant 
http://myServerApp.com
MADRID · NOV 21-22 · 2014 
Authorization code grant 
https://facebook.com/dialog/oauth 
?response_type=code 
&client_id=YOUR_CLIENT_ID 
&redirect_uri= 
http://myServerApp.com/oauth 
&scope=email,public_profile
MADRID · NOV 21-22 · 2014 
Authorization code grant 
hhttttpp::////fmacyeSbeorvoekr.Acopmp.com
MADRID · NOV 21-22 · 2014 
Authorization code grant 
hhttttpp:s/://m/faycSeebrvoeorkA.cpopm.com
MADRID · NOV 21-22 · 2014 
Authorization code grant 
https://myServerApp.com/oauth?code=CODE 
Finishing authentication...
Authorization code grant 
Server-side POST request to: https://graph. 
facebook.com/oauth/access_token 
With this body: 
grant_type=authorization_code 
&code=CODE_FROM_QUERY_STRING 
&redirect_uri=http://myServerApp.com 
&client_id=YOUR_CLIENT_ID 
&client_secret=YOUR_CLIENT_SECRET 
MADRID · NOV 21-22 · 2014
MADRID · NOV 21-22 · 2014 
Authorization code grant 
Example response: 
{ 
"access_token": "RsT5OjbzRn430zqMLgV3Ia", 
"token_type": "Bearer", 
"expires_in": 3600, 
"refresh_token": "e1qoXg7Ik2RRua48lXIV" 
}
MADRID · NOV 21-22 · 2014 
Implicit grant 
● For web applications running on the browser 
(eg: AngularJS, etc) or mobile apps. 
● Client credentials confidentiality cannot be 
guaranteed. 
● Similar to the code grant, but in this case, the 
client gets an access token directly.
MADRID · NOV 21-22 · 2014 
Implicit grant 
http://myFrontendApp.com/#/home
MADRID · NOV 21-22 · 2014 
Implicit grant 
https://facebook.com/dialog/oauth 
?response_type=token 
&client_id=YOUR_CLIENT_ID 
&redirect_uri= 
http://myFrontendApp.com/#/cb 
&scope=email,public_profile
MADRID · NOV 21-22 · 2014 
Implicit grant 
hhttttpp:s/://m/faycSeebrvoeorkA.cpopm.com
MADRID · NOV 21-22 · 2014 
Implicit grant 
https://myFrontendApp.com/#/cb?token=TOKEN 
Finishing authentication...
MADRID · NOV 21-22 · 2014 
Password credentials grant 
● In this case, client collects username and 
password to get an access token directly. 
● Viable solution only for trusted clients: 
○ The official website consumer of your API. 
○ The official mobile app consuming your API. 
○ Etc.
MADRID · NOV 21-22 · 2014 
Password credentials grant
Password credentials grant 
POST request to: https://api.example. 
org/oauth/access_token 
With this body: 
grant_type=password 
&username=USERNAME&password=PASSWORD 
&client_id=YOUR_CLIENT_ID 
&client_secret=YOUR_CLIENT_SECRET 
MADRID · NOV 21-22 · 2014
MADRID · NOV 21-22 · 2014 
Password credentials grant 
Example response: 
{ 
"access_token": "RsT5OjbzRn430zqMLgV3Ia", 
"token_type": "Bearer", 
"expires_in": 3600, 
"refresh_token": "e1qoXg7Ik2RRua48lXIV" 
}
MADRID · NOV 21-22 · 2014 
Client credentials grant 
● Service-to-service authentication, without a 
particular user being involved. 
○ Eg: the Orders microservice making a request to the 
Invoicing microservice. 
● The application authenticates itself using its 
client ID and client secret.
Client credentials grant 
POST request to: https://api.example. 
org/oauth/access_token 
With this body: 
grant_type=client_credentials 
&client_id=YOUR_CLIENT_ID 
&client_secret=YOUR_CLIENT_SECRET 
MADRID · NOV 21-22 · 2014
MADRID · NOV 21-22 · 2014 
Client credentials grant 
Example response: 
{ 
"access_token": "RsT5OjbzRn430zqMLgV3Ia", 
"token_type": "Bearer", 
"expires_in": 3600, 
"refresh_token": "e1qoXg7Ik2RRua48lXIV" 
}
Accessing the protected resource 
Once the client has an access token, it can 
request a protected resource: 
GET /games HTTP/1.1 
Host: api.example.org 
Authorization: Bearer RsT5OjbzRn430zqMLgV3Ia 
MADRID · NOV 21-22 · 2014
Token expiration and refresh 
● If the Authorization Server issues expiring 
tokens, they will be paired with refresh 
tokens. 
● When the access token has expired, the 
refresh token can be used to get a new access 
token. 
MADRID · NOV 21-22 · 2014
Tips for a front-end application 
MADRID · NOV 21-22 · 2014 
● Use the implicit grant. 
○ Already supported for 3rd party providers like Google, 
Facebook. 
○ If you hold your own users, have your backend to 
implement the OAuth 2.0 Authorization Server role. 
● Use HTML5’s localStorage for access and 
refresh tokens.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Stateful vs. Stateless 
● Authorization Servers are often stateful 
services. 
○ They store issued access tokens in databases for future 
checking. 
● How can we achieve statelessness? 
○ Issuing JWT tokens as access tokens.
MADRID · NOV 21-22 · 2014 
Introducing JWT 
JSON Web Token is a compact URL-safe means of 
representing claims to be transferred between 
two parties. The claims are encoded as a JSON 
object that is digitally signed by hashing it using 
a shared secret between the parties.
Introducing JWT... in Plain English 
A secure way to encapsulate arbitrary data that 
can be sent over unsecure URL’s. 
MADRID · NOV 21-22 · 2014
MADRID · NOV 21-22 · 2014 
When can JWT be useful? 
● When generating “one click” action emails. 
○ Eg: “delete this comment”, “add this to favorites”. 
● To achieve Single Sign-On. 
○ Sharing the JWT between different applications. 
● Whenever you need to securely send a payload. 
○ Eg: to “obscure” URL parameters or POST bodies.
Header Claims 
MADRID · NOV 21-22 · 2014 
How does a JWT look like? 
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. 
eyJleHAiOjE0MTY0NzE5MzQsInVzZXJfbmFtZSI6InV 
zZXIiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYX 
V0aG9yaXRpZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfV 
VNFUiJdLCJqdGkiOiI5YmM5MmE0NC0wYjFhLTRjNWUt 
YmU3MC1kYTUyMDc1YjlhODQiLCJjbGllbnRfaWQiOiJ 
teS1jbGllbnQtd2l0aC1zZWNyZXQifQ. 
AZCTD_fiCcnrQR5X7rJBQ5rO-2Qedc5_3qJJf-ZCvVY 
Signature
MADRID · NOV 21-22 · 2014 
JWT Header 
{ 
"alg": "HS256", 
"typ": "JWT" 
}
MADRID · NOV 21-22 · 2014 
JWT Claims 
{ 
"exp": 1416471934, 
"user_name": "user", 
"scope": [ 
"read", 
"write" 
], 
"authorities": [ 
"ROLE_ADMIN", 
"ROLE_USER" 
], 
"jti": "9bc92a44-0b1a-4c5e-be70-da52075b9a84", 
"client_id": "my-client-with-secret" 
}
MADRID · NOV 21-22 · 2014 
Signature 
HMACSHA256( 
base64(header) + "." + base64(payload), 
"secret" 
)
Sample access token response 
MADRID · NOV 21-22 · 2014 
{ 
"access_token": "eyJhbGciOiJIUzI1NiJ9. 
eyJleHAiOjE0MTY0NzEwNTUsInVzZXJfbmFtZSI6InVzZXIiLCJzY29wZS 
I6WyJyZWFkIiwid3JpdGUiXSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9BRE1J 
TiIsIlJPTEVfVVNFUiJdLCJqdGkiOiIzZGJjODE4Yi0wMjAyLTRiYzItYT 
djZi1mMmZlNjY4MjAyMmEiLCJjbGllbnRfaWQiOiJteS1jbGllbnQtd2l0 
aC1zZWNyZXQifQ. 
Wao_6hLnOeMHS4HEel1UGWt1g86ad9N0qCexr1IL7IM", 
"token_type": "bearer", 
"expires_in": 43199, 
"scope": "read write", 
"jti": "3dbc818b-0202-4bc2-a7cf-f2fe6682022a" 
}
MADRID · NOV 21-22 · 2014 
Achieving statelessness 
● Instead of storing the access token / principal 
relationship in a stateful way, do it on a JWT. 
● Access tokens with the JWT-encoded 
principal can be securely stored on the client’s 
browser. 
● That way you are achieving one of the basic 
principles of REST: State Transfer.
MADRID · NOV 21-22 · 2014 
Tips for using JWT 
● JWT claims are just signed by default (JWS - 
JSON Web Signature). 
○ It prevents the content to be tampered. 
● Use encryption to make it bomb proof. 
○ Use any algorithm supported by JWE - JSON Web 
Encryption.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Agenda 
1. Authentication in monolithic applications vs 
microservices. 
2. Introduction to OAuth 2.0. 
3. Achieving statelessness with JWT. 
4. Demo. 
5. Q&A.
MADRID · NOV 21-22 · 2014 
Thanks! 
Álvaro Sánchez-Mariscal 
Web Architect 
Daniel Ortega Segura 
Senior Grails Developer

More Related Content

What's hot

Introduction to OpenID Connect
Introduction to OpenID Connect Introduction to OpenID Connect
Introduction to OpenID Connect Nat Sakimura
 
Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid  Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid WinWire Technologies Inc
 
From Zero to A11Y: Building an Accessibility Culture
From Zero to A11Y: Building an Accessibility CultureFrom Zero to A11Y: Building an Accessibility Culture
From Zero to A11Y: Building an Accessibility CultureVMware Tanzu
 
FIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptxFIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptxFIDO Alliance
 
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -Naoto Miyachi
 
OpenID ConnectとSCIMの標準化動向
OpenID ConnectとSCIMの標準化動向OpenID ConnectとSCIMの標準化動向
OpenID ConnectとSCIMの標準化動向Tatsuo Kudo
 
俺が考えた最強のID連携デザインパターン
俺が考えた最強のID連携デザインパターン俺が考えた最強のID連携デザインパターン
俺が考えた最強のID連携デザインパターンMasaru Kurahayashi
 
Implementing WebAuthn & FAPI supports on Keycloak
Implementing WebAuthn & FAPI supports on KeycloakImplementing WebAuthn & FAPI supports on Keycloak
Implementing WebAuthn & FAPI supports on KeycloakYuichi Nakamura
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?GlobalLogic Ukraine
 
API-first development
API-first developmentAPI-first development
API-first developmentVasco Veloso
 
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装FIDO Alliance
 
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in Europe
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in EuropeFIDO & PSD2: Solving the Strong Customer Authentication Challenge in Europe
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in EuropeFIDO Alliance
 
Beyond Passwords: FIDO and the Future of User Authentication
Beyond Passwords: FIDO and the Future of User AuthenticationBeyond Passwords: FIDO and the Future of User Authentication
Beyond Passwords: FIDO and the Future of User AuthenticationFIDO Alliance
 
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...Yuichi Nakamura
 
Getting Started with FIDO2
Getting Started with FIDO2Getting Started with FIDO2
Getting Started with FIDO2FIDO Alliance
 

What's hot (17)

CEIS110 final project
CEIS110 final projectCEIS110 final project
CEIS110 final project
 
Introduction to OpenID Connect
Introduction to OpenID Connect Introduction to OpenID Connect
Introduction to OpenID Connect
 
Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid  Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid
 
From Zero to A11Y: Building an Accessibility Culture
From Zero to A11Y: Building an Accessibility CultureFrom Zero to A11Y: Building an Accessibility Culture
From Zero to A11Y: Building an Accessibility Culture
 
FIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptxFIDO Workshop-Demo Breakdown.pptx
FIDO Workshop-Demo Breakdown.pptx
 
Micro Frontends
Micro FrontendsMicro Frontends
Micro Frontends
 
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -
今更聞けない電子認証入門 - OAuth 2.0/OIDCからFIDOまで -
 
OpenID ConnectとSCIMの標準化動向
OpenID ConnectとSCIMの標準化動向OpenID ConnectとSCIMの標準化動向
OpenID ConnectとSCIMの標準化動向
 
俺が考えた最強のID連携デザインパターン
俺が考えた最強のID連携デザインパターン俺が考えた最強のID連携デザインパターン
俺が考えた最強のID連携デザインパターン
 
Implementing WebAuthn & FAPI supports on Keycloak
Implementing WebAuthn & FAPI supports on KeycloakImplementing WebAuthn & FAPI supports on Keycloak
Implementing WebAuthn & FAPI supports on Keycloak
 
“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?“How to Secure Your Applications With a Keycloak?
“How to Secure Your Applications With a Keycloak?
 
API-first development
API-first developmentAPI-first development
API-first development
 
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装
2019 FIDO Tokyo Seminar - LINE PayへのFIDO2実装
 
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in Europe
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in EuropeFIDO & PSD2: Solving the Strong Customer Authentication Challenge in Europe
FIDO & PSD2: Solving the Strong Customer Authentication Challenge in Europe
 
Beyond Passwords: FIDO and the Future of User Authentication
Beyond Passwords: FIDO and the Future of User AuthenticationBeyond Passwords: FIDO and the Future of User Authentication
Beyond Passwords: FIDO and the Future of User Authentication
 
Implementing security requirements for banking API system using Open Source ...
 Implementing security requirements for banking API system using Open Source ... Implementing security requirements for banking API system using Open Source ...
Implementing security requirements for banking API system using Open Source ...
 
Getting Started with FIDO2
Getting Started with FIDO2Getting Started with FIDO2
Getting Started with FIDO2
 

Viewers also liked

Codemotion 2014 - Hackathones - de 0 a produccion en 24 horas
Codemotion 2014 - Hackathones - de 0 a produccion en 24 horasCodemotion 2014 - Hackathones - de 0 a produccion en 24 horas
Codemotion 2014 - Hackathones - de 0 a produccion en 24 horasAdolfo Sanz De Diego
 
Mejora tus retrospectivas (codemotion 2014)
Mejora tus retrospectivas (codemotion 2014)Mejora tus retrospectivas (codemotion 2014)
Mejora tus retrospectivas (codemotion 2014)Juanma Gómez
 
Scrum bad smells (codemotion 2014)
Scrum bad smells (codemotion 2014)Scrum bad smells (codemotion 2014)
Scrum bad smells (codemotion 2014)Juanma Gómez
 
#PlatziConf - El camino para ser un Pro en JavaScript
#PlatziConf - El camino para ser un Pro en JavaScript#PlatziConf - El camino para ser un Pro en JavaScript
#PlatziConf - El camino para ser un Pro en JavaScriptCarlos Azaustre
 
Stateless authentication for microservices - Spring I/O 2015
Stateless authentication for microservices  - Spring I/O 2015Stateless authentication for microservices  - Spring I/O 2015
Stateless authentication for microservices - Spring I/O 2015Alvaro Sanchez-Mariscal
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring SecurityOrest Ivasiv
 
OAuth and OpenID Connect for Microservices
OAuth and OpenID Connect for MicroservicesOAuth and OpenID Connect for Microservices
OAuth and OpenID Connect for MicroservicesTwobo Technologies
 
Stateless authentication for microservices
Stateless authentication for microservicesStateless authentication for microservices
Stateless authentication for microservicesAlvaro Sanchez-Mariscal
 
Conhecendo NancyFX!
Conhecendo NancyFX!Conhecendo NancyFX!
Conhecendo NancyFX!Luis Rudge
 
Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. GoThree Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. GoChristian Horsdal
 
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...Alberto Sanz Herrero
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authenticationjeremysbrown
 
Java & JWT Stateless authentication
Java & JWT Stateless authenticationJava & JWT Stateless authentication
Java & JWT Stateless authenticationKarlo Novak
 
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)iMasters
 
Token Based Authentication Systems with AngularJS & NodeJS
Token Based Authentication Systems with AngularJS & NodeJSToken Based Authentication Systems with AngularJS & NodeJS
Token Based Authentication Systems with AngularJS & NodeJSHüseyin BABAL
 
Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Alvaro Sanchez-Mariscal
 
2016 pycontw web api authentication
2016 pycontw web api authentication 2016 pycontw web api authentication
2016 pycontw web api authentication Micron Technology
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React TogetherSebastian Pederiva
 
Json web token api authorization
Json web token api authorizationJson web token api authorization
Json web token api authorizationGiulio De Donato
 
Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Matt Raible
 

Viewers also liked (20)

Codemotion 2014 - Hackathones - de 0 a produccion en 24 horas
Codemotion 2014 - Hackathones - de 0 a produccion en 24 horasCodemotion 2014 - Hackathones - de 0 a produccion en 24 horas
Codemotion 2014 - Hackathones - de 0 a produccion en 24 horas
 
Mejora tus retrospectivas (codemotion 2014)
Mejora tus retrospectivas (codemotion 2014)Mejora tus retrospectivas (codemotion 2014)
Mejora tus retrospectivas (codemotion 2014)
 
Scrum bad smells (codemotion 2014)
Scrum bad smells (codemotion 2014)Scrum bad smells (codemotion 2014)
Scrum bad smells (codemotion 2014)
 
#PlatziConf - El camino para ser un Pro en JavaScript
#PlatziConf - El camino para ser un Pro en JavaScript#PlatziConf - El camino para ser un Pro en JavaScript
#PlatziConf - El camino para ser un Pro en JavaScript
 
Stateless authentication for microservices - Spring I/O 2015
Stateless authentication for microservices  - Spring I/O 2015Stateless authentication for microservices  - Spring I/O 2015
Stateless authentication for microservices - Spring I/O 2015
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
OAuth and OpenID Connect for Microservices
OAuth and OpenID Connect for MicroservicesOAuth and OpenID Connect for Microservices
OAuth and OpenID Connect for Microservices
 
Stateless authentication for microservices
Stateless authentication for microservicesStateless authentication for microservices
Stateless authentication for microservices
 
Conhecendo NancyFX!
Conhecendo NancyFX!Conhecendo NancyFX!
Conhecendo NancyFX!
 
Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. GoThree Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
 
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...
Quita, que tú no sabes; ya lo hago yo. Generación e inyección de código en ti...
 
Web API 2 Token Based Authentication
Web API 2 Token Based AuthenticationWeb API 2 Token Based Authentication
Web API 2 Token Based Authentication
 
Java & JWT Stateless authentication
Java & JWT Stateless authenticationJava & JWT Stateless authentication
Java & JWT Stateless authentication
 
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)PHP Experience 2016 - [Palestra] Json Web Token (JWT)
PHP Experience 2016 - [Palestra] Json Web Token (JWT)
 
Token Based Authentication Systems with AngularJS & NodeJS
Token Based Authentication Systems with AngularJS & NodeJSToken Based Authentication Systems with AngularJS & NodeJS
Token Based Authentication Systems with AngularJS & NodeJS
 
Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015Stateless authentication for microservices - GR8Conf 2015
Stateless authentication for microservices - GR8Conf 2015
 
2016 pycontw web api authentication
2016 pycontw web api authentication 2016 pycontw web api authentication
2016 pycontw web api authentication
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
Json web token api authorization
Json web token api authorizationJson web token api authorization
Json web token api authorization
 
Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016Testing Angular 2 Applications - Rich Web 2016
Testing Angular 2 Applications - Rich Web 2016
 

Similar to Stateless token-based authentication for pure front-end applications

Stateless authentication for microservices applications - JavaLand 2015
Stateless authentication for microservices applications -  JavaLand 2015Stateless authentication for microservices applications -  JavaLand 2015
Stateless authentication for microservices applications - JavaLand 2015Alvaro Sanchez-Mariscal
 
Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Alvaro Sanchez-Mariscal
 
OAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersOAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersPrabath Siriwardena
 
Auth proxy pattern on Kubernetes
Auth proxy pattern on KubernetesAuth proxy pattern on Kubernetes
Auth proxy pattern on KubernetesMichał Wcisło
 
Accessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) webAccessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) webFelix Arntz
 
[WSO2Con EU 2018] Identity APIs is the New Black
[WSO2Con EU 2018] Identity APIs is the New Black[WSO2Con EU 2018] Identity APIs is the New Black
[WSO2Con EU 2018] Identity APIs is the New BlackWSO2
 
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2Profesia Srl, Lynx Group
 
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...Torsten Lodderstedt
 
Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018MOnCloud
 
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptx
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptxMuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptx
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptxShiva Sahu
 
Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...WSO2
 
OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)Torsten Lodderstedt
 
Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Aaron Ralls
 
APIs: The Gateway to Digital Transformation
APIs: The Gateway to Digital TransformationAPIs: The Gateway to Digital Transformation
APIs: The Gateway to Digital TransformationWSO2
 
OpenID for Verifiable Credentials
OpenID for Verifiable CredentialsOpenID for Verifiable Credentials
OpenID for Verifiable CredentialsTorsten Lodderstedt
 
Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Brent Shambaugh
 
OAuth and OpenID Connect for PSD2 and Third-Party Access
OAuth and OpenID Connect for PSD2 and Third-Party AccessOAuth and OpenID Connect for PSD2 and Third-Party Access
OAuth and OpenID Connect for PSD2 and Third-Party AccessNordic APIs
 
[WSO2Con USA 2018] Identity APIs is the New Black
[WSO2Con USA 2018] Identity APIs is the New Black[WSO2Con USA 2018] Identity APIs is the New Black
[WSO2Con USA 2018] Identity APIs is the New BlackWSO2
 
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...Torsten Lodderstedt
 

Similar to Stateless token-based authentication for pure front-end applications (20)

Stateless authentication for microservices applications - JavaLand 2015
Stateless authentication for microservices applications -  JavaLand 2015Stateless authentication for microservices applications -  JavaLand 2015
Stateless authentication for microservices applications - JavaLand 2015
 
Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015Stateless authentication for microservices - Greach 2015
Stateless authentication for microservices - Greach 2015
 
OAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App DevelopersOAuth 2.0 for Web and Native (Mobile) App Developers
OAuth 2.0 for Web and Native (Mobile) App Developers
 
OpenID Connect Explained
OpenID Connect ExplainedOpenID Connect Explained
OpenID Connect Explained
 
Auth proxy pattern on Kubernetes
Auth proxy pattern on KubernetesAuth proxy pattern on Kubernetes
Auth proxy pattern on Kubernetes
 
Accessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) webAccessing APIs using OAuth on the federated (WordPress) web
Accessing APIs using OAuth on the federated (WordPress) web
 
[WSO2Con EU 2018] Identity APIs is the New Black
[WSO2Con EU 2018] Identity APIs is the New Black[WSO2Con EU 2018] Identity APIs is the New Black
[WSO2Con EU 2018] Identity APIs is the New Black
 
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
#5 WSO2 Masterclassitalia - WSO2 Identity Server, un approccio OAUTH2
 
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
 
Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018Microservices security - jpmc tech fest 2018
Microservices security - jpmc tech fest 2018
 
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptx
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptxMuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptx
MuleSoft_Meetup__Official__updated_Sep_2020_ (1) (1).pptx
 
Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...Setting the Foundation for Digital Transformation Through API Management and ...
Setting the Foundation for Digital Transformation Through API Management and ...
 
OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)OpenID 4 Verifiable Credentials + HAIP (Update)
OpenID 4 Verifiable Credentials + HAIP (Update)
 
Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4Authorization and Authentication using IdentityServer4
Authorization and Authentication using IdentityServer4
 
APIs: The Gateway to Digital Transformation
APIs: The Gateway to Digital TransformationAPIs: The Gateway to Digital Transformation
APIs: The Gateway to Digital Transformation
 
OpenID for Verifiable Credentials
OpenID for Verifiable CredentialsOpenID for Verifiable Credentials
OpenID for Verifiable Credentials
 
Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments Introduction to Linked Data and Web Payments
Introduction to Linked Data and Web Payments
 
OAuth and OpenID Connect for PSD2 and Third-Party Access
OAuth and OpenID Connect for PSD2 and Third-Party AccessOAuth and OpenID Connect for PSD2 and Third-Party Access
OAuth and OpenID Connect for PSD2 and Third-Party Access
 
[WSO2Con USA 2018] Identity APIs is the New Black
[WSO2Con USA 2018] Identity APIs is the New Black[WSO2Con USA 2018] Identity APIs is the New Black
[WSO2Con USA 2018] Identity APIs is the New Black
 
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
How to Build Interoperable Decentralized Identity Systems with OpenID for Ver...
 

More from Alvaro Sanchez-Mariscal

Asynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAsynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAlvaro Sanchez-Mariscal
 
Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018Alvaro Sanchez-Mariscal
 
Reactive microservices with Micronaut - Greach 2018
Reactive microservices with Micronaut - Greach 2018Reactive microservices with Micronaut - Greach 2018
Reactive microservices with Micronaut - Greach 2018Alvaro Sanchez-Mariscal
 
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...Alvaro Sanchez-Mariscal
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Alvaro Sanchez-Mariscal
 
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring SecurityDesarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring SecurityAlvaro Sanchez-Mariscal
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...Alvaro Sanchez-Mariscal
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Alvaro Sanchez-Mariscal
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Alvaro Sanchez-Mariscal
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...Alvaro Sanchez-Mariscal
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Alvaro Sanchez-Mariscal
 
Creating applications with Grails, Angular JS and Spring Security
Creating applications with Grails, Angular JS and Spring SecurityCreating applications with Grails, Angular JS and Spring Security
Creating applications with Grails, Angular JS and Spring SecurityAlvaro Sanchez-Mariscal
 
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016Alvaro Sanchez-Mariscal
 
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Alvaro Sanchez-Mariscal
 
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Alvaro Sanchez-Mariscal
 

More from Alvaro Sanchez-Mariscal (20)

Serverless functions with Micronaut
Serverless functions with MicronautServerless functions with Micronaut
Serverless functions with Micronaut
 
Asynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applicationsAsynchronous and event-driven Grails applications
Asynchronous and event-driven Grails applications
 
6 things you need to know about GORM 6
6 things you need to know about GORM 66 things you need to know about GORM 6
6 things you need to know about GORM 6
 
Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018
 
Reactive microservices with Micronaut - Greach 2018
Reactive microservices with Micronaut - Greach 2018Reactive microservices with Micronaut - Greach 2018
Reactive microservices with Micronaut - Greach 2018
 
Practical Spring Cloud
Practical Spring CloudPractical Spring Cloud
Practical Spring Cloud
 
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring SecurityDesarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016
 
Creating applications with Grails, Angular JS and Spring Security
Creating applications with Grails, Angular JS and Spring SecurityCreating applications with Grails, Angular JS and Spring Security
Creating applications with Grails, Angular JS and Spring Security
 
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
 
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
 
Ratpack 101 - GR8Conf 2015
Ratpack 101 - GR8Conf 2015Ratpack 101 - GR8Conf 2015
Ratpack 101 - GR8Conf 2015
 
Ratpack 101 - GeeCON 2015
Ratpack 101 - GeeCON 2015Ratpack 101 - GeeCON 2015
Ratpack 101 - GeeCON 2015
 
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
Workshop: Creating RESTful API’s with Grails and Spring Security (GR8Conf 2014)
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 

Stateless token-based authentication for pure front-end applications

  • 1. Stateless token-based authentication for pure front-end applications MADRID · NOV 21-22 · 2014 Álvaro Sánchez-Mariscal Web Architect Daniel Ortega Segura Senior Grails Developer
  • 2. About us - Álvaro Sánchez-Mariscal ● Passionate Software Developer. ● Worked at IBM BCS, BEA Systems and Sun Microsystems. ● Founded Salenda and Escuela de Groovy. ● Working now at as a Web Architect. ● Living between Madrid and Gibraltar. MADRID · NOV 21-22 · 2014
  • 3. About us - Daniel Ortega Segura MADRID · NOV 21-22 · 2014 ● Enthusiast guitarist ● Rubik’s cubes freak ● Senior Grails Developer at
  • 4. MADRID · NOV 21-22 · 2014 About us - ● HTML5 games platform. ● We provide game developers a Javascript SDK. ● Server side logic and maths are handled by our industry certified game engines. ● Seamless integration with several casinos. ● Check out play.odobo.com and play for free!
  • 5. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 6. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 7. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 8. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 9. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 10. Authentication in monolithic apps ● Historically, authentication has always been a stateful service. ● When moving to Single-Page Applications, and/or having mobile clients, it becomes an issue. ● If you are build a REST and stateless API, your authentication should be that way too. MADRID · NOV 21-22 · 2014
  • 13. Authentication and microservices ● Authentication: to verify the identity of the user given the credentials received. ● Authorization: to determine if the user should be granted access to a particular resource. ● In a microservices context: ○ Authentication can be a microservice itself. ○ Authorization is a common functionality in all of them. MADRID · NOV 21-22 · 2014
  • 14. Authentication and microservices Catalog DB Invoicing DB MADRID · NOV 21-22 · 2014 Javascript front-end UI Mobile app Authentication Service Shopping cart Service Catalog Service Orders Service Shipping Service User repository Shipping partners Web Backend Mobile Backend
  • 15. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 16. MADRID · NOV 21-22 · 2014 Introducing OAuth 2.0 An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.
  • 17. MADRID · NOV 21-22 · 2014 OAuth 2.0: roles Resource Owner: the person or the application that holds the data to be shared. Resource Server: the application that holds the protected resources. Authorization Server: the application that verifies the identity of the users. Client: the application that makes requests to the RS on behalf of the RO.
  • 18. MADRID · NOV 21-22 · 2014 OAuth 2.0: roles Resource Owner: the person or the application that holds the data to be shared. Resource Server: the application that holds the protected resources. Authorization Server: the application that verifies the identity of the users. Client: the application that makes requests to the RS on behalf of the RO.
  • 19. MADRID · NOV 21-22 · 2014 OAuth 2.0: roles Resource Owner: the person or the application that holds the data to be shared. Resource Server: the application that holds the protected resources. Authorization Server: the application that verifies the identity of the users. Client: the application that makes requests to the RS on behalf of the RO.
  • 20. MADRID · NOV 21-22 · 2014 OAuth 2.0: roles Resource Owner: the person or the application that holds the data to be shared. Resource Server: the application that holds the protected resources. Authorization Server: the application that verifies the identity of the users. Client: the application that makes requests to the RS on behalf of the RO.
  • 21. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow I want to see a list of games
  • 22. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Hey, backend, could you please give me a list of games?
  • 23. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Sorry mate, this is a protected resource. You will need to present me an access token
  • 24. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Hi Google, can I get an access token please? Backend is asking
  • 25. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Sure thing sir. I just need to ask a few details to the user first
  • 26. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Hi, could you please provide me your credentials? I need to verify your identity
  • 27. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow That’s no problem at all. I am bob@gmail.com and my password is secret.
  • 28. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow The user is who claims to be. Here is your access token: qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa
  • 29. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Hi Backend, this is my token: qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa
  • 30. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Hi, I’ve been given qfE2KhvKggluHqe7IpTBqZ4qziTQQbKa. Could you please tell me who it belongs to?
  • 31. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Of course. That token is still valid and it belongs to bob@gmail.com.
  • 32. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Everything is allright. This is the list of games. Enjoy!
  • 33. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow Here you are the list of games.Thank you for your business and have a good day!
  • 34. MADRID · NOV 21-22 · 2014 OAuth 2.0: protocol flow OAuth 2.0 is a delegation protocol, as this guy has no idea about the credentials of this guy
  • 35. MADRID · NOV 21-22 · 2014 OAuth 2.0: grant types ● Authorization code: for web server applications. ● Implicit: for JS front-ends and mobile apps. ● Resource Owner Password Credentials: for trusted clients. ● Client credentials: for service authentication.
  • 36. Authorization code grant ● For server-based applications, where the client ID and secret are securely stored. ● It’s a redirect flow, so it’s for web server apps. ● The client (web server app) redirects the user to the authorization server to get a code. ● Then, using the code and its client credentials MADRID · NOV 21-22 · 2014 asks for an access token.
  • 37. MADRID · NOV 21-22 · 2014 Authorization code grant http://myServerApp.com
  • 38. MADRID · NOV 21-22 · 2014 Authorization code grant https://facebook.com/dialog/oauth ?response_type=code &client_id=YOUR_CLIENT_ID &redirect_uri= http://myServerApp.com/oauth &scope=email,public_profile
  • 39. MADRID · NOV 21-22 · 2014 Authorization code grant hhttttpp::////fmacyeSbeorvoekr.Acopmp.com
  • 40. MADRID · NOV 21-22 · 2014 Authorization code grant hhttttpp:s/://m/faycSeebrvoeorkA.cpopm.com
  • 41. MADRID · NOV 21-22 · 2014 Authorization code grant https://myServerApp.com/oauth?code=CODE Finishing authentication...
  • 42. Authorization code grant Server-side POST request to: https://graph. facebook.com/oauth/access_token With this body: grant_type=authorization_code &code=CODE_FROM_QUERY_STRING &redirect_uri=http://myServerApp.com &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET MADRID · NOV 21-22 · 2014
  • 43. MADRID · NOV 21-22 · 2014 Authorization code grant Example response: { "access_token": "RsT5OjbzRn430zqMLgV3Ia", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "e1qoXg7Ik2RRua48lXIV" }
  • 44. MADRID · NOV 21-22 · 2014 Implicit grant ● For web applications running on the browser (eg: AngularJS, etc) or mobile apps. ● Client credentials confidentiality cannot be guaranteed. ● Similar to the code grant, but in this case, the client gets an access token directly.
  • 45. MADRID · NOV 21-22 · 2014 Implicit grant http://myFrontendApp.com/#/home
  • 46. MADRID · NOV 21-22 · 2014 Implicit grant https://facebook.com/dialog/oauth ?response_type=token &client_id=YOUR_CLIENT_ID &redirect_uri= http://myFrontendApp.com/#/cb &scope=email,public_profile
  • 47. MADRID · NOV 21-22 · 2014 Implicit grant hhttttpp:s/://m/faycSeebrvoeorkA.cpopm.com
  • 48. MADRID · NOV 21-22 · 2014 Implicit grant https://myFrontendApp.com/#/cb?token=TOKEN Finishing authentication...
  • 49. MADRID · NOV 21-22 · 2014 Password credentials grant ● In this case, client collects username and password to get an access token directly. ● Viable solution only for trusted clients: ○ The official website consumer of your API. ○ The official mobile app consuming your API. ○ Etc.
  • 50. MADRID · NOV 21-22 · 2014 Password credentials grant
  • 51. Password credentials grant POST request to: https://api.example. org/oauth/access_token With this body: grant_type=password &username=USERNAME&password=PASSWORD &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET MADRID · NOV 21-22 · 2014
  • 52. MADRID · NOV 21-22 · 2014 Password credentials grant Example response: { "access_token": "RsT5OjbzRn430zqMLgV3Ia", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "e1qoXg7Ik2RRua48lXIV" }
  • 53. MADRID · NOV 21-22 · 2014 Client credentials grant ● Service-to-service authentication, without a particular user being involved. ○ Eg: the Orders microservice making a request to the Invoicing microservice. ● The application authenticates itself using its client ID and client secret.
  • 54. Client credentials grant POST request to: https://api.example. org/oauth/access_token With this body: grant_type=client_credentials &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET MADRID · NOV 21-22 · 2014
  • 55. MADRID · NOV 21-22 · 2014 Client credentials grant Example response: { "access_token": "RsT5OjbzRn430zqMLgV3Ia", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "e1qoXg7Ik2RRua48lXIV" }
  • 56. Accessing the protected resource Once the client has an access token, it can request a protected resource: GET /games HTTP/1.1 Host: api.example.org Authorization: Bearer RsT5OjbzRn430zqMLgV3Ia MADRID · NOV 21-22 · 2014
  • 57. Token expiration and refresh ● If the Authorization Server issues expiring tokens, they will be paired with refresh tokens. ● When the access token has expired, the refresh token can be used to get a new access token. MADRID · NOV 21-22 · 2014
  • 58. Tips for a front-end application MADRID · NOV 21-22 · 2014 ● Use the implicit grant. ○ Already supported for 3rd party providers like Google, Facebook. ○ If you hold your own users, have your backend to implement the OAuth 2.0 Authorization Server role. ● Use HTML5’s localStorage for access and refresh tokens.
  • 59. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 60. MADRID · NOV 21-22 · 2014 Stateful vs. Stateless ● Authorization Servers are often stateful services. ○ They store issued access tokens in databases for future checking. ● How can we achieve statelessness? ○ Issuing JWT tokens as access tokens.
  • 61. MADRID · NOV 21-22 · 2014 Introducing JWT JSON Web Token is a compact URL-safe means of representing claims to be transferred between two parties. The claims are encoded as a JSON object that is digitally signed by hashing it using a shared secret between the parties.
  • 62. Introducing JWT... in Plain English A secure way to encapsulate arbitrary data that can be sent over unsecure URL’s. MADRID · NOV 21-22 · 2014
  • 63. MADRID · NOV 21-22 · 2014 When can JWT be useful? ● When generating “one click” action emails. ○ Eg: “delete this comment”, “add this to favorites”. ● To achieve Single Sign-On. ○ Sharing the JWT between different applications. ● Whenever you need to securely send a payload. ○ Eg: to “obscure” URL parameters or POST bodies.
  • 64. Header Claims MADRID · NOV 21-22 · 2014 How does a JWT look like? eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJleHAiOjE0MTY0NzE5MzQsInVzZXJfbmFtZSI6InV zZXIiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiYX V0aG9yaXRpZXMiOlsiUk9MRV9BRE1JTiIsIlJPTEVfV VNFUiJdLCJqdGkiOiI5YmM5MmE0NC0wYjFhLTRjNWUt YmU3MC1kYTUyMDc1YjlhODQiLCJjbGllbnRfaWQiOiJ teS1jbGllbnQtd2l0aC1zZWNyZXQifQ. AZCTD_fiCcnrQR5X7rJBQ5rO-2Qedc5_3qJJf-ZCvVY Signature
  • 65. MADRID · NOV 21-22 · 2014 JWT Header { "alg": "HS256", "typ": "JWT" }
  • 66. MADRID · NOV 21-22 · 2014 JWT Claims { "exp": 1416471934, "user_name": "user", "scope": [ "read", "write" ], "authorities": [ "ROLE_ADMIN", "ROLE_USER" ], "jti": "9bc92a44-0b1a-4c5e-be70-da52075b9a84", "client_id": "my-client-with-secret" }
  • 67. MADRID · NOV 21-22 · 2014 Signature HMACSHA256( base64(header) + "." + base64(payload), "secret" )
  • 68. Sample access token response MADRID · NOV 21-22 · 2014 { "access_token": "eyJhbGciOiJIUzI1NiJ9. eyJleHAiOjE0MTY0NzEwNTUsInVzZXJfbmFtZSI6InVzZXIiLCJzY29wZS I6WyJyZWFkIiwid3JpdGUiXSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9BRE1J TiIsIlJPTEVfVVNFUiJdLCJqdGkiOiIzZGJjODE4Yi0wMjAyLTRiYzItYT djZi1mMmZlNjY4MjAyMmEiLCJjbGllbnRfaWQiOiJteS1jbGllbnQtd2l0 aC1zZWNyZXQifQ. Wao_6hLnOeMHS4HEel1UGWt1g86ad9N0qCexr1IL7IM", "token_type": "bearer", "expires_in": 43199, "scope": "read write", "jti": "3dbc818b-0202-4bc2-a7cf-f2fe6682022a" }
  • 69. MADRID · NOV 21-22 · 2014 Achieving statelessness ● Instead of storing the access token / principal relationship in a stateful way, do it on a JWT. ● Access tokens with the JWT-encoded principal can be securely stored on the client’s browser. ● That way you are achieving one of the basic principles of REST: State Transfer.
  • 70. MADRID · NOV 21-22 · 2014 Tips for using JWT ● JWT claims are just signed by default (JWS - JSON Web Signature). ○ It prevents the content to be tampered. ● Use encryption to make it bomb proof. ○ Use any algorithm supported by JWE - JSON Web Encryption.
  • 71. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 72. MADRID · NOV 21-22 · 2014 Agenda 1. Authentication in monolithic applications vs microservices. 2. Introduction to OAuth 2.0. 3. Achieving statelessness with JWT. 4. Demo. 5. Q&A.
  • 73. MADRID · NOV 21-22 · 2014 Thanks! Álvaro Sánchez-Mariscal Web Architect Daniel Ortega Segura Senior Grails Developer