Interface AuthContext
-
- All Known Implementing Classes:
JAASAuthContext
,LocalAuthContext
public interface AuthContext
An authentication context used to authenticate users. It is similar to JAAS'LoginContext
but can work in a non-JAAS environment.This class is abstract and has two implementations:
JAASAuthContext
which delegates to a regular JAASLoginContext
LocalAuthContext
which implements authentication using a locally-defined JAASLoginModule
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Subject
getSubject()
Return the authenticated Subject.void
login()
Perform the authentication and, if successful, associate Principals and Credentials with the authenticatedSubject
.void
logout()
Logout theSubject
.
-
-
-
Method Detail
-
login
void login() throws LoginException
Perform 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
null
if authentication failed. - See Also:
LoginContext.getSubject()
-
logout
void logout() throws LoginException
Logout theSubject
.- Throws:
LoginException
- if the logout fails.- See Also:
LoginContext.logout()
-
-