jaas java authentication and authorization service api master seminar advanced software engineering...
TRANSCRIPT
![Page 1: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/1.jpg)
JAAS
Java Authentication And Authorization Service API
Master Seminar
Advanced Software Engineering Topics
Matthias Buchs
![Page 2: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/2.jpg)
Contenu
Introduction JAAS, Vue d’ensemble Programmation avec JAAS
Login Code utilisateur Administration JAAS Programmation JAAS avancée
Déroulement d’un Login Conclusion
![Page 3: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/3.jpg)
Introduction
Java « standard » protège l’utilisateur du monde: Sandbox nous protège des programmes méchants Signatures assurent l’intégrité des données Cryptage assure la confidentialité
JAAS protège le monde de l’utilisateur: Donne des permissions à un utilisateur authentifié Utilise des mécanismes de sécurité déjà existants:
NIS (Network Information Service) WinNT, Solaris LDAP Kerberos
![Page 4: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/4.jpg)
JAAS, Vue d’ensemble
Fonctionnement de JAAS: Créer un contexte login Appeler la méthode login() sur cet objet Exécuter doAs() avec le code d’utilisateur Appeler la méthode logout()
![Page 5: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/5.jpg)
Architecture de JAAS
![Page 6: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/6.jpg)
Code JAAS basic
![Page 7: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/7.jpg)
Programmation avec JAAS
LoginContext Contexte pour authentifier un utilisateur Configuration du login dans un fichier
Subject Représente un utilisateur authentifié Encapsule un tableau de Principals Un Principal représente une propriété d’un
utilisateur: No AVS, Nom WinNT ou Solaris etc.
![Page 8: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/8.jpg)
Code utilisateur
![Page 9: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/9.jpg)
Configuration JAAS I
Configuration des modules login Un module login fait effectivement
l’authentification Un module ajoute un ou plusieurs Principal au Subject.
Noms des classes dans un fichier de configuration, pas dans le code
classname control-flag [optional parameters];
![Page 10: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/10.jpg)
Configuration JAAS II
![Page 11: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/11.jpg)
Configuration JAAS III
Login control flags: required Ce module est toujours appelé et le test doit
toujours être passé. sufficient Si l'utilisateur passe le test
d'authentification de ce module, aucun autre module est appelé à part les required.
requisite Si l'utilisateur passe le test d'authentification de ce module, d'autres modules sont aussi appelés mais ils peuvent échouer.
obtional Le test peut échouer.
![Page 12: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/12.jpg)
Fichier de Police JAAS
![Page 13: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/13.jpg)
Fichier de Police Standard
![Page 14: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/14.jpg)
Préparation pour l’exécution
Séparer le code en deux parties Créer le fichier de configuration JAAS Créer le fichier de police JAAS Créer le fichier de police standard java -classpath ".;.\classes" \
-Djava.security.manager \-Djava.security.policy=java.policy \-Djava.security.auth.policy=jaas.policy \-Djava.security.auth.login.config=JaasDemo.config \jaasdemo.jaasgui.GUIClient
![Page 15: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/15.jpg)
Programmation JAAS avancée CallbackHandler
Obtenir des information de l’utilisateur Passé en paramètre au contexte login Traite des objets Callback
Callback Objet pour passer des données (mot de
passe, nom d’utilisateur…) de l’utilisateur vers le module login
![Page 16: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/16.jpg)
CallbackHandler
![Page 17: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/17.jpg)
Ecrire un module login
Un module login implémente le système d’authentification
Pour changer ou adapter ce système il suffit de programmer une classe qui implémente l’interface LoginModule.
Méthodes à implémenter: public void initialize() public boolean login() public boolean commit() public boolean abort() public boolean logout()
![Page 18: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/18.jpg)
Principal
![Page 19: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/19.jpg)
Déroulement d’un Login I
![Page 20: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/20.jpg)
Déroulement d’un Login II
![Page 21: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/21.jpg)
Déroulement d’un Login III
![Page 22: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/22.jpg)
Conclusion
Authentification Autorisation à la base d’une identité Configuration souple Séparation des algorithmes d’authentification
de la couche application Facilite la vie d’un programmeur Complique un peu celle d’un administrateur
![Page 23: JAAS Java Authentication And Authorization Service API Master Seminar Advanced Software Engineering Topics Matthias Buchs](https://reader034.vdocuments.us/reader034/viewer/2022052522/551d9dba497959293b8de0db/html5/thumbnails/23.jpg)
Questions?