Wikipedia (de): Java Authentication and Authorization Service. https://de.wikipedia.org/wiki/Java_Authentication_and_Authorization_Service (abgerufen am 14. Jan. 2020)
barthel (https://github.com/barthel)
Java-API um Dienste zur Authentifizierung und Autorisierung in Java Anwendungen bereitzustellen
Implementiert das Pluggable Authentication Modules (PAM) Konzept [PAM].
Seit Java 1.4 Teil der Platform.
Wikipedia (de): Java Authentication and Authorization Service. https://de.wikipedia.org/wiki/Java_Authentication_and_Authorization_Service (abgerufen am 14. Jan. 2020)
Verifizierung einer Entität (bspw. ein Mensch oder Gerät)
Synonym für Prüfung (Authentifikation) und Bezeugung (Authentifizierung) der Echtheit
Zuverlässig und sicher feststellen, wer gerade Java-Code ausführt [1].
[1] Übersetzung aus [GUIDE]
Wikipedia (de): Java Authentication and Authorization Service. https://de.wikipedia.org/wiki/Java_Authentication_and_Authorization_Service (abgerufen am 14. Jan. 2020)
gebündelt in package javax.security.auth
Basisklassen
javax.security.auth.Subject, javax.security.Principal, Credentials
Klassen für Authentifizierung
javax.security.auth.login.LoginContext,javax.security.auth.login.Configuration, javax.security.auth.spi.LoginModule, javax.security.auth.callback.CallbackHandler, javax.security.auth.callback.Callback, java.security.AccessControlContext
javax.security.auth.SubjectQuelle einer Anfrage
vertritt jedwede Entity (bspw. Mensch, Gerät)
Verwaltet Identitäten (Principal) sowie Anmeldeinformationen (Credential)
Anmeldeinformationen werden in öffentliche und private Informationen unterschieden.
Kann eingefroren (read-only) werden
wird in der Regel automatisch erzeugt
javax.security.PrincipalRepräsentation einer Identität
Implementierung muss java.io.Serializable implementieren
CredentialsAnmeldeinformationen bspw. Rollen oder Rechte
keine eigene Klassenhierarchie
java.lang.Object
Implementierung muss java.io.Serializable implementieren
Implementierung von javax.security.auth.Refreshable für zeitabhängige Anmeldeinformationen
Implementierung von javax.security.auth.Destroyable für sensible Informationen
javax.security.auth.login.LoginContextSchnittstelle zur anwendungsspezifischen Authentifizierung
Erzeugt — wenn nötig — Subject
Erzeugt und führt die konfigurierten (Configuration) LoginModule aus
Stellt Callbackhandler für die LoginModule bereit
javax.security.auth.login.ConfigurationDefiniert, welche LoginModule für eine Anwendung augeführt werden
Jeder Eintrag hat einen eindeutigen Namen
Standardimplementierung Konfiguration über Datei
Konfiguration über Startparameter java.security.auth.login.config als URL.
Login {
com.sun.security.auth.module.UnixLoginModule required;
com.sun.security.auth.module.Krb5LoginModule optional
useTicketCache="true"
ticketCache="${user.home}${/}tickets";
};JavaDoc von javax.security.auth.login.Configuration: https://docs.oracle.com/javase/8/docs/api/javax/security/auth/login/Configuration.html (abgerufen 14. Jan. 2020)
javax.security.auth.spi.LoginModuleInterface zur Implementierung unterschiedlicher Authentifizierungstechnologien/-mechanismen
Definierter Ablauf der Authentifizierung
public interface LoginModule {
/**
* Initialize this LoginModule.
*/
void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options);
/**
* Method to authenticate a {@code Subject} (phase 1).
*/
boolean login() throws LoginException;
/**
* Method to commit the authentication process (phase 2).
*/
boolean commit() throws LoginException;
/**
* Method to abort the authentication process (phase 2).
*/
boolean abort() throws LoginException;
/**
* Method which logs out a {@code Subject}.
*/
boolean logout() throws LoginException;
}javax.security.auth.callback.CallbackHandlerVerbindung von LoginModule zur Anwendung
Bereitstellen von anwendungs-, benutzerspezifische Anfragen, Anzeigen (Callback)
LoginModule muss Callback-Klassen kennen
public interface CallbackHandler {
void handle(Callback[] callbacks) throws java.io.IOException, UnsupportedCallbackException;
}javax.security.auth.callback.CallbackInterface für spezifische Callback Implementierung
Informationstranzfer zwischen Anwendung und LoginModule
Standardimplementierungen
javax.security.auth.callback.NameCallback, javax.security.auth.callback.PasswordCallback u.a.
java.security.AccessControlContext[PAM] Wikipedia (de): Pluggable Authentication Modules. https://de.wikipedia.org/wiki/Pluggable_Authentication_Modules (abgerufen am 14. Jan. 2020)
[GUIDE] Oracle Corporation: Java Authentication and Authorization Service (JAAS) Reference Guide. https://docs.oracle.com/javase/8/docs/technotes/guides/security/jaas/JAASRefGuide.html Java 8. (abgerufen am 14. Jan. 2020)
[TUTORIAL] Oracle Corporation: JAAS Authentication Tutorial. https://docs.oracle.com/javase/8/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html Java 8. (abgerufen am 14. Jan. 2020)
[DEVGUIDE] Oracle Corporation. Java Authentication and Authorization Service (JAAS): LoginModule Developer’s Guide. https://docs.oracle.com/javase/8/docs/technotes/guides/security/jaas/JAASLMDevGuide.html Java 8. (abgerufen am 14. Jan. 2020)
[SECURITY] Oracle Corporation. Security. https://docs.oracle.com/javase/8/docs/technotes/guides/security/ Java 8. (abgerufen am 14. Jan. 2020)
[INSIDE] Li Gong, Gary Ellison, Mary Dageforde: Inside Java 2 Platform Security, Second Edition - Architecture, API Design, and Implementation. 2003. Addision-Wesley, Pearson Education. 2003. ISBN 0-201-78791-1