introducción al protocolo oauth 2.0

29
Introducción al Protocolo OAuth 2.0 Securizando Servicios Web Ejemplos prácticos de uso Álvaro Alonso

Upload: alvaro-alonso

Post on 07-Aug-2015

89 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Introducción al Protocolo OAuth 2.0

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

2

Page 3: Introducción al Protocolo OAuth 2.0

3

Page 4: Introducción al Protocolo OAuth 2.0

OAuth 2.0

4

Page 5: Introducción al Protocolo OAuth 2.0

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

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

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

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

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

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

Arquitectura OAuth 2.0 Client Credentials Grant

11

Client myservice.com

Resource Owner

Auth Server

Page 12: Introducción al Protocolo OAuth 2.0

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

Hello OAuth Quién es quién

13

Page 14: Introducción al Protocolo OAuth 2.0

Hello OAuth Web server applications

14

Page 15: Introducción al Protocolo OAuth 2.0

Hello OAuth Web server applications

15

Authorization Code Grant

Page 16: Introducción al Protocolo OAuth 2.0

Hello OAuth Installed applications

16

Page 17: Introducción al Protocolo OAuth 2.0

Hello OAuth Installed applications

17

Authorization Code Grant

Page 18: Introducción al Protocolo OAuth 2.0

Hello OAuth Client-side (JavaScript) applications

18

Page 19: Introducción al Protocolo OAuth 2.0

Hello OAuth Client-side (JavaScript) applications

19

Implicit Grant

Page 20: Introducción al Protocolo OAuth 2.0

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

Hello OAuth Demo

21

Page 22: Introducción al Protocolo OAuth 2.0

Pero…

22

Client myservice.com

Resource Owner

Auth Server

Resource owner

Page 23: Introducción al Protocolo OAuth 2.0

¡  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

24

Page 25: Introducción al Protocolo OAuth 2.0

25

Account

Page 26: Introducción al Protocolo OAuth 2.0

FIWARE Account Login

26

Signin with

Page 27: Introducción al Protocolo OAuth 2.0

FIWARE Account Generic Enablers

27

Page 28: Introducción al Protocolo OAuth 2.0

FIWARE Account Otros backends

28

Page 29: Introducción al Protocolo OAuth 2.0

Introducción al Protocolo OAuth 2.0 Securizando Servicios Web Ejemplos prácticos de uso

Álvaro Alonso