[JDLL 2016] OpenID Connect et FranceConnect

Preview:

Citation preview

2

Clément OUDOT@clementoudot

http://sflx.ca/coudot

● Créé en 1999● >100 personnes● Montréal, Quebec City, Ottawa, Paris● ISO 9001:2004 / ISO 14001:2008● contact@savoirfairelinux.com

3

Sommaire

1.France Connect, à quoi ça sert ?

2.Le protocole OpenID Connect

3.Utilisation avec le logiciel libre LemonLDAP::NG

4

À quoi ça sert ?

5

Un service d'authentification

● FranceConnect ne fournit pas directement l'authentification, mais s'appuie sur des fournisseurs d'identités agréés, comme le service des impôts

● Après authentification, une « identité pivot » est transmise au service final (site d'une mairie, service public, etc.)

● Les échanges sont réalisés à l'aide du protocole OpenID Connect

6

7

Consulter les points de son permis

8

Site service-public.fr

9

Identité pivot (particulier)Champs Type Description

given_name string prénoms séparés par des espaces (standard OpenIDConnect)

family_name string le nom de famille de naissance (standard OpenIDConnect)

birthdate string la date de naissance au format YYYY-MM-DD (standard OpenIDConnect)

gender string male pour les hommes, female pour les femmes (standard OpenIDConnect)

birthplace stringle code INSEE du lieu de naissance (ou une chaîne vide si la personne est née à l'étranger)

birthcountry string le code INSEE du pays de naissance

10

Identité pivot (entreprise)

Champs Type Description

given_name string prénoms séparés par des espaces (standard OpenIDConnect)

family_name string le nom de famille (standard OpenIDConnect)

email string l'adresse mail de la personne

siret string le numéro SIRET ou SIREN de l'entreprise (non standard)

11

Le protocole

12

13

Rôles

Resource owner(end-user)

Client(third-party)

AuthorizationServer

ResourceServer

14

Authorization Request

Authorization Grant

Authorization Grant

Access Token

Access Token

Protected Resource

15

Authorization

GET /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb

https://client.example.com/cb?code=SplxlOBeZQQYbYS6WxSbIA&state=xyz

16

Token

POST /token HTTP/1.1Host: server.example.comAuthorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JWContent-Type: application/x-www-form-urlencoded

grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb

17

Token

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8Cache-Control: no-storePragma: no-cache

{"access_token":"2YotnFZFEjr1zCsicMWpAA","token_type":"example","expires_in":3600,"refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA","example_parameter":"example_value"}

18

Resource

GET /resource/1 HTTP/1.1Host: example.comAuthorization: Bearer 2YotnFZFEjr1zCsicMWpAA

19

20

OpenID 1.0 OpenID 2.0 OpenID Connect

21

RPRP OPOP

(1) AuthN Request

(2) AuthN & AuthZ

(3) AuthN Response

(4) UserInfo Request

(5) UserInfo Response

22

OpenID Connect Protocol Suite

Core DiscoveryDynamic Client

Registration

Session Management

Form Post Response Mode

Minimal

Dynamic

Complete

23

Underpinnings

OAuth 2.0 Core

OAuth 2.0 Bearer

OAuth 2.0 Assertions

OAuth 2.0 JWT Profile

OAuth 2.0 Responses

JWT JWS JWE JWK JWA WebFinger

JOSE

24

http://jwt.io/

25

RPRP OPOP

http://auth.example.com/oauth2/authorize? response_type=code &client_id=lemonldap&scope=openid%20profile%20email&redirect_uri=http%3A%2F%2Fauth.example.com%2Foauth2.pl%3Fopenidconnectcallback%3D1&state=ABCDEFGHIJKLMNOPQRSTUVWXXZ

26

27

28

RPRP OPOPhttp://auth.example.com/oauth2.pl?openidconnectcallback=1;code=f6267efe92d0fc39bf2761c29de44286;state=ABCDEFGHIJKLMNOPQRSTUVWXXZ

29

RPRP OPOP

POST /oauth2/token HTTP/1.1Host: auth.example.comAuthorization: Basic xxxxContent-Type: application/x-www-form-urlencoded

grant_type=authorization_code&code=f6267efe92d0fc39bf2761c29de44286&redirect_uri=http%3A%2F%2Fauth.example.com%2Foauth2.pl%3Fopenidconnectcallback%3D1

30

RPRP OPOP

{"id_token" :"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3IiOiJsb2EtMiIsImF1dGhfdGltZSI6MTQzMjExMzU5MywiaWF0IjoxNDMyMTEzOTY2LCJhdF9oYXNoIjoiOWF4enNOaTlwTkRrNXpXZWZLc002QSIsImlzcyI6Imh0dHA6Ly9hdXRoLmV4YW1wbGUuY29tLyIsImV4cCI6IjM2MDAiLCJhenAiOiJsZW1vbmxkYXAiLCJub25jZSI6IjEyMzQ1Njc4OTAiLCJzdWIiOiJjb3Vkb3RAbGluYWdvcmEuY29tIiwiYXVkIjpbImxlbW9ubGRhcCJdfQ==.daYGlzIr37dC1R0biIwdvQLM1LlCMsBFFcEufeMZtXsZvCiiAm-1LFJwJJJDHFOhd-WQnc9_GvtP3gTabXB8U4gQ2IW-bPNLUsjT24njmBPYunHy8YTQ5PV-QnQI5EK5WrrTS04AF86U5Qu6m3b27yWKFXkIuGI7EUvvByv8L1Anh1gPG3il5cEOnMFHIUzAaC6PkJiy1sjSBM53nLRAf9NQ6eux4iCVBIRwl26CCgmRTsTRy-iTxB3bf0LrILohUlAR_-HPWGseaIAMvqUpGeaovgGDPt4Zip9KERo7368ykgQc09VFlLvZIwyMTWQdVBIYdW0oY6eI9ZHjofn0mg", "expires_in" : "3600","access_token" : "512cdb7b97e073d0656ac9684cc715fe", "token_type" : "Bearer"}

31

{ "acr": "loa-2", "auth_time": 1432113593, "iat": 1432113966, "at_hash": "9axzsNi9pNDk5zWefKsM6A", "iss": "http://auth.example.com/", "exp": "3600", "azp": "lemonldap", "nonce": "1234567890", "sub": "clement@oudot.me", "aud": [ "lemonldap" ]}

ID Token payload

32

RPRP OPOP

POST /oauth2/userinfo HTTP/1.1Host: auth.example.comAuthorization: Bearer 512cdb7b97e073d0656ac9684cc715feContent-Type: application/x-www-form-urlencoded

33

RPRP OPOP

{ "name": "Clément OUDOT", "email": "clement@oudot.me", "sub": "clement@oudot.me"}

34

Utilisation avec le logiciel libre

35

LemonLDAP::NG

● Logiciel libre (GPLv2+) / OW2 consortium● Authentification unique (SSO), contrôle d'accès● Fournisseur de Service / Fournisseur d'Identité● Perl/Apache/CGI/FCGI● Réinitialisation de mot de passe et création de compte● http://www.lemonldap-ng.org

36

37

Lien LL::NG / FranceConnect

● LemonLDAP::NG peut être configuré comme SP OpenID Connect

● France Connect peut être déclaré comme IDP OpenID Connect

● Procédure détaillée : http://lemonldap-ng.org/documentation/latest/authopenidconnect_franceconnect

● Démonstration : https://auth.openid.club/

38

Des questions ?

On dirait qu'ils ont tout compris

Recommended