Class LoginContext
- java.lang.Object
-
- com.sun.identity.authentication.jaas.LoginContext
-
- All Implemented Interfaces:
LoginContext
public class LoginContext extends Object implements LoginContext
This class is pulled out from JDK1.4. RemoveddoPrivileged()oninvoke()method so that Error and Runtime exceptions can be passed back to the caller. Otherwise any exception is converted toLoginException.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLoginContext.ModuleInfoLoginModule information - encapsulates Configuration info and actual module instances.
-
Constructor Summary
Constructors Constructor Description LoginContext(AppConfigurationEntry[] entries, CallbackHandler callbackHandler)LoginContext(AppConfigurationEntry[] entries, Subject subject, CallbackHandler callbackHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getModuleInstanceNames()Returns module instance names listLoginContext.ModuleInfo[]getModuleStack()LinkedList<LoginContext.ModuleInfo>getModuleStackQueue()LoginExceptiongetOptionalException()LoginExceptiongetRequiredException()SubjectgetSubject()Return the authenticated Subject.voidlogin()Perform the authentication.voidlogout()Logout theSubject.voidresetAuthChainToModule(int moduleIndex)Resets auth chain to particular module, auth chain starts with this modulevoidsetModuleStackQueue(LinkedList<LoginContext.ModuleInfo> moduleStackQueue)voidsetNextModule(int moduleIndex)Sets next module by module index in chain, allows to modify auth chain during authvoidsetNextModule(String moduleName)Sets next module by module name, allows to modify auth chain during auth
-
-
-
Constructor Detail
-
LoginContext
public LoginContext(AppConfigurationEntry[] entries, CallbackHandler callbackHandler) throws LoginException
- Throws:
LoginException
-
LoginContext
public LoginContext(AppConfigurationEntry[] entries, Subject subject, CallbackHandler callbackHandler) throws LoginException
- Throws:
LoginException
-
-
Method Detail
-
login
public void login() throws LoginExceptionDescription copied from interface:LoginContextPerform the authentication.- Specified by:
loginin interfaceLoginContext- Throws:
LoginException- if the authentication fails.
-
logout
public void logout() throws LoginExceptionDescription copied from interface:LoginContextLogout theSubject.- Specified by:
logoutin interfaceLoginContext- Throws:
LoginException- if the logout fails.
-
getModuleStack
public LoginContext.ModuleInfo[] getModuleStack()
-
getSubject
public Subject getSubject()
Description copied from interface:LoginContextReturn the authenticated Subject.- Specified by:
getSubjectin interfaceLoginContext- Returns:
- the authenticated subject.
-
setNextModule
public void setNextModule(String moduleName)
Sets next module by module name, allows to modify auth chain during auth- Parameters:
moduleName-
-
setNextModule
public void setNextModule(int moduleIndex)
Sets next module by module index in chain, allows to modify auth chain during auth- Parameters:
moduleName-
-
getModuleInstanceNames
public List<String> getModuleInstanceNames()
Returns module instance names list- Returns:
- module instance names list
-
resetAuthChainToModule
public void resetAuthChainToModule(int moduleIndex) throws ResetAuthChainExceptionResets auth chain to particular module, auth chain starts with this module- Parameters:
moduleIndex- index of module- Throws:
ResetAuthChainException
-
getRequiredException
public LoginException getRequiredException()
-
getOptionalException
public LoginException getOptionalException()
-
getModuleStackQueue
public LinkedList<LoginContext.ModuleInfo> getModuleStackQueue()
-
setModuleStackQueue
public void setModuleStackQueue(LinkedList<LoginContext.ModuleInfo> moduleStackQueue)
-
-