Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Authentification, confidentialité, gestion des ...

Authentification, confidentialité, gestion des identités ... au secours, je confonds tout !

Comme tout développeur, vous connaissez un peu l'authentification par login, et le SSO. Vous avez des notions de OAuth et OpenId Connect et avez entendu parler de SAML, mais tout cela reste à la fois ennuyeux et un peu confus. Il est temps de faire le point de façon rigoureuse, en prenant comme exemple concret un système de baby-sitting avec des services backend REST et Spring Boot. Et je vous promets d'expliquer tout cela de façon plus joyeuse que dans ma thèse !

Avatar for Olfa Mabrouki

Olfa Mabrouki

April 21, 2018

Other Decks in Programming

Transcript

  1. #DevoxxFR 3 Montures marrons Cheveux châtains mi-longs Visage rond Rouge

    à lèvres Haut en motif Identité 2/6 #DevoxxFR @somabrouki
  2. #DevoxxFR 6 Identité 5/6 Olfa Maman Employeur Amie Identités Applications

    Babysitting Logiciel de paie Réseau social #DevoxxFR @somabrouki
  3. #DevoxxFR 7 Identité 6/6 Olfa Maman 2 Unicité des identités

    Application Babysitting Maman 1 Alice #DevoxxFR @somabrouki
  4. #DevoxxFR 9 Authentification Olfa Cherche une nounou Vérifier l'identité présumée

    : - d’une personne - de toute autre entité #DevoxxFR @somabrouki
  5. #DevoxxFR Authentification unique 15 Avant le SSO Login1/Pwd1 Login2/Pwd2 Login3/Pwd3

    Login4/Pwd4 Login5/Pwd5 Avec le Single Sign On (SSO) Login/Pwd #DevoxxFR @somabrouki
  6. #DevoxxFR Autorisation 23 Eve est autorisée (gestionnaire du dossier) Olfa

    Dossier d’Olfa Dossier d’Alice Alice #DevoxxFR @somabrouki
  7. #DevoxxFR Autorisation 24 Eve est autorisée (gestionnaire du dossier) Olfa

    Dossier d’Olfa Dossier d’Alice Alice #DevoxxFR @somabrouki
  8. #DevoxxFR Confidentialité 26 Eve est un tiers de confiance Olfa

    - CIN - Date de naissance #DevoxxFR @somabrouki
  9. #DevoxxFR 31 Resource Owner Client Authorization Server Resource Server Liste

    des nounous sur Paris En coulisse ... #DevoxxFR @somabrouki
  10. #DevoxxFR 32 Resource Owner Client Authorization Server Resource Server la

    liste des nounous sur Paris, stp ? coucou backend ! En coulisse ... #DevoxxFR @somabrouki
  11. #DevoxxFR 33 Resource Owner Client Authorization Server Resource Server Access

    token ? Désolé ! Ressource protégée ! En coulisse ... #DevoxxFR @somabrouki
  12. #DevoxxFR 34 Resource Owner Client Authorization Server Resource Server Hey

    Google ! Access Token, stp ? En coulisse ... #DevoxxFR @somabrouki
  13. #DevoxxFR 36 Resource Owner Client Authorization Server Resource Server Pas

    de problème ! Je suis [email protected] & mot de passe 2bb80d537b1da3e38bd30361aa855686bde0e acd7162fef6a25fe97bf527a25b En coulisse ... #DevoxxFR @somabrouki
  14. #DevoxxFR 37 Resource Owner Client Authorization Server Resource Server Access

    Token eyJzdWIiOiJvbGZhIiwiaXNzIjoiYXV0a En coulisse ... #DevoxxFR @somabrouki
  15. #DevoxxFR 38 Resource Owner Client Authorization Server Resource Server Token

    eyJzdWIiOiJvbGZhIiwiaXNzIjoiYXV0a Coucou backend ! En coulisse ... #DevoxxFR @somabrouki
  16. #DevoxxFR 39 Resource Owner Client Authorization Server Resource Server Token

    eyJzdWIiOiJvbGZhIiwiaXNzIjoiYXV0a À qui appartient-t-il ? En coulisse ... #DevoxxFR @somabrouki
  17. #DevoxxFR 41 Resource Owner Client Authorization Server Resource Server Tout

    va bien ! Voici la liste des nounous sur Paris ! En coulisse ... #DevoxxFR @somabrouki
  18. #DevoxxFR 42 Resource Owner Client Authorization Server Resource Server Voici

    la liste des nounous sur Paris ! En coulisse ... #DevoxxFR @somabrouki
  19. #DevoxxFR 53 Application de babysitting Billing Microservice Scheduling Microservice Subscribing

    Microservice Client Applications Authentication & Authorization Server Gateway Auth & Accès ? Accès à une ressource Par Olfa Par Olfa Par Olfa #DevoxxFR @somabrouki
  20. #DevoxxFR 57 Maintien du contexte de l’authentification Billing Microservice Scheduling

    Microservice Subscribing Microservice Auth & Accès Olfa Gateway Par Olfa Par Olfa Par Olfa Accès à une ressource #DevoxxFR @somabrouki
  21. #DevoxxFR 58 Propagation de l’identité de l’utilisateur Billing Microservice Scheduling

    Microservice Subscribing Microservice Auth & SSO Olfa Par Olfa Accès à une ressource #DevoxxFR @somabrouki
  22. #DevoxxFR Configuration avec Spring Security @Configuration @EnableWebSecurity public class WebSecurityConfig

    extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable().authorizeRequests() .antMatchers("/").permitAll() .antMatchers(HttpMethod.POST, "/login").permitAll() .anyRequest().authenticated() .and() .addFilterBefore(new JWTLoginFilter("/login", authenticationManager()), UsernamePasswordAuthenticationFilter.class) .addFilterBefore(new JWTAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class); } } 61 @somabrouki
  23. #DevoxxFR Configuration avec Spring Security avec Auth0 @Configuration @EnableWebSecurity public

    class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Value("${auth0.audience}") private String audience; @Value("${auth0.issuer}") private String issuer; @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/").permitAll() .antMatchers("/users").authenticated(); JwtWebSecurityConfigurer .forRS256(audience, issuer) .configure(http); } } 68 @somabrouki