Interface AuthContext
-
- All Known Implementing Classes:
JAASAuthContext,LocalAuthContext
public interface AuthContextAn authentication context used to authenticate users. It is similar to JAAS'LoginContextbut can work in a non-JAAS environment.This class is abstract and has two implementations:
JAASAuthContextwhich delegates to a regular JAASLoginContextLocalAuthContextwhich implements authentication using a locally-defined JAASLoginModule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SubjectgetSubject()Return the authenticated Subject.voidlogin()Perform the authentication and, if successful, associate Principals and Credentials with the authenticatedSubject.voidlogout()Logout theSubject.
-
-
-
Method Detail
-
login
void login() throws LoginExceptionPerform the authentication and, if successful, associate Principals and Credentials with the authenticatedSubject.- Throws:
LoginException- if the authentication fails.- See Also:
LoginContext.login()
-
getSubject
Subject getSubject()
Return the authenticated Subject.- Returns:
- the authenticated Subject or
nullif authentication failed. - See Also:
LoginContext.getSubject()
-
logout
void logout() throws LoginExceptionLogout theSubject.- Throws:
LoginException- if the logout fails.- See Also:
LoginContext.logout()
-
-