@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Build the future
Sécuriser son API avec OpenID Connect
Damien Baron & Jérémy Pinsolle
Xebia
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Qui sommes-nous ?
Damien Baron
Développeur Back / Cloud
Jérémy Pinsolle
Développeur Back / Cloud
@dambaron @jpinsolle
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Quelques minutes de théorie sur OpenID Connect
3
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Un but simple
4
Identifier la personne derrière le navigateur ou
l’application connectée à mon service
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Une nouvelle norme ?
5
OAuth2 est juste une boîte à outils conceptuelle
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
OpenID Connect remplace OAuth2 ?
6
Regrouper, préciser et compléter OAuth2
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
7
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Mais la VRAIE différence avec OAuth2 alors ?
8
OAuth2 = Authentification
OIDC = Authentification + Identification
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
9
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
10
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Et en pratique ?
11
Authentification = Access token
Identification = Identity token (JWT)
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Des tokens JWT ?
12
JWT = <header>.<claims>.<signature>
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Utiliser OpenID Connect
13
Microsoft
Azure AD
AWS
Cognito
Google
Identity
Facebook
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Démonstration
14
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Démonstration
15
access_token
id_token
access_token
id_token
check
token
signature
Vérification du token côté
API
1. Vérifier que le token est
bien formé (Header / claims /
signature)
2. Vérifier la signature
3. Valider les claims
a. Token expiration <exp>
b. Token issuer : <iss>
c. Token audience <aud>
4. Vérifier les permissions
(scopes)
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Et s’il ne fallait retenir qu’une chose ?
16
(Identification, Authentification) + OAuth 2.0
=
OpenID Connect
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Des questions ?
17
https://github.com/jerep6/openid-connect
@Xebiconfr #Xebicon18
@dambaron
@jpinsolle
Crédits photo
18
● Dictionary / Focus
○ Photo par Romain Vignes via Unsplash
● Door light modern
○ Photo par Cherish DeAlba via Pixabay
● Business card
○ Photo par Tero Vesalainen via Pixabay
● Anonymous
○ Photo par Thomas Vanhaecht via Pexels
● Hacker hacking password with padlock and fingerprint
○ Photo par Mike Corbett via Flickr
● Windmill gears
○ Photo par Malcolm Lightbody via Unsplash
● Pile of question marks
○ Photo par Arek Socha via Pixabay

XebiCon'18 - Sécuriser son API avec OpenID Connect