introducción al protocolo oauth 2.0 securizando …posgrado/web2015-2016...
TRANSCRIPT
![Page 1: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/1.jpg)
Introducción al Protocolo OAuth 2.0 Securizando Servicios Web Ejemplos prácticos de uso
Álvaro Alonso
![Page 2: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/2.jpg)
2
![Page 3: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/3.jpg)
3
![Page 4: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/4.jpg)
OAuth 2.0
4
![Page 5: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/5.jpg)
Agenda
¡ Introducción al protocolo
¡ Roles
¡ Arquitectura OAuth 2.0
¡ Grant-types
¡ Hello OAuth
¡ Google Accounts
¡ FIWARE Account
¡ Securizando backends
5
![Page 6: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/6.jpg)
Introducción al protocolo
¡ Permitir a las aplicaciones el acceso a recursos protegidos
¡ Sin compartir credenciales
¡ Las aplicaciones utilizan access tokens
¡ Creadas por los proveedores Oauth
¡ Permiten el acceso a los recursos
¡ Especificación diseñada para el uso con HTTP
¡ Especificación
¡ http://oauth.net/2/
¡ http://tools.ietf.org/html/rfc6749
6
![Page 7: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/7.jpg)
Introducción al protocolo
¡ Resource Owner
¡ Entidad capaz de permitir el acceso a los recursos protegidos
¡ e.g. usuario final
¡ Resource Server
¡ Servidor que aloja los recursos protegidos
¡ Client
¡ Aplicación que solicita los recursos protegidos en nombre del Resource Owner
¡ Authorization Server
¡ El servidor que provee access tokens al cliente
Roles
7
![Page 8: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/8.jpg)
Arquitectura OAuth 2.0 Authorization Code Grant
8
Client myservice.com
Resource Owner
Auth Server
Resource owner
![Page 9: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/9.jpg)
Arquitectura OAuth 2.0 Implicit Grant
9
Client myservice.com
Resource Owner
Auth Server
Resource owner
![Page 10: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/10.jpg)
Arquitectura OAuth 2.0 Resource Owner Password
Credentials Grant
10
Client myservice.com
Resource Owner
Auth Server
Resource owner
![Page 11: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/11.jpg)
Arquitectura OAuth 2.0 Client Credentials Grant
11
Client myservice.com
Resource Owner
Auth Server
![Page 12: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/12.jpg)
Hello OAuth
¡ Documentación Google Developers
¡ https://developers.google.com/identity/protocols/OAuth2
¡ Librerías OAuth 2.0
¡ http://oauth.net/2/
¡ Ejemplo básico Node.js
¡ https://github.com/aalonsog/oauth2-master
¡ Google OAuth 2.0 Playground
¡ https://developers.google.com/oauthplayground/
Google Accounts
12
![Page 13: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/13.jpg)
Hello OAuth Quién es quién
13
![Page 14: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/14.jpg)
Hello OAuth Web server applications
14
![Page 15: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/15.jpg)
Hello OAuth Web server applications
15
Authorization Code Grant
![Page 16: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/16.jpg)
Hello OAuth Installed applications
16
![Page 17: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/17.jpg)
Hello OAuth Installed applications
17
Authorization Code Grant
![Page 18: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/18.jpg)
Hello OAuth Client-side (JavaScript) applications
18
![Page 19: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/19.jpg)
Hello OAuth Client-side (JavaScript) applications
19
Implicit Grant
![Page 20: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/20.jpg)
Hello OAuth
1. Tener una cuenta en Google Accounts
o Si usas Gmail ya tienes una!
2. Crear un nuevo proyecto en Developers Console
o https://console.developers.google.com/project
3. Obtener credenciales de OAuth 2.0
o Dependiendo del tipo de Grant Type
o Configurar pantalla de autorización
4. Configurar nuestra librería de OAuth 2.0
Pasos
20
![Page 21: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/21.jpg)
Hello OAuth Demo
21
![Page 22: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/22.jpg)
Pero…
22
Client myservice.com
Resource Owner
Auth Server
Resource owner
![Page 23: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/23.jpg)
¡ Open initiative to create a technologic ecosystem
¡ APIs for smart applications ¡ Public and royalty-free
¡ Open source reference
¡ FIWARE Lab ¡ Non-commercial sandbox for experimentation ¡ Open data published by cities
¡ Distributed among several regions
¡ FIWARE Ops ¡ Set of tools for deployment and operation
¡ UPM takes part in four Chapters ¡ Sustainability Support Tools
¡ Security ¡ Cloud Hosting
¡ Applications/Services and Data Delivery
23
![Page 24: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/24.jpg)
24
![Page 25: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/25.jpg)
25
Account
![Page 26: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/26.jpg)
FIWARE Account Login
26
Signin with
![Page 27: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/27.jpg)
FIWARE Account Generic Enablers
27
![Page 28: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/28.jpg)
FIWARE Account Otros backends
28
![Page 29: Introducción al Protocolo OAuth 2.0 Securizando …posgrado/web2015-2016 archivada/SI/2014...Introducción al protocolo ! Resource Owner! Entidad capaz de permitir el acceso a los](https://reader033.vdocument.in/reader033/viewer/2022041720/5e4e25a8be3c0c4bd01bcbd3/html5/thumbnails/29.jpg)
Introducción al Protocolo OAuth 2.0 Securizando Servicios Web Ejemplos prácticos de uso
Álvaro Alonso