public class AMLoginContext extends Object
AMLoginContext
class is the core layer in the authentication
middle tier which connects user clients to the JAAS LoginModule
.
The AMLoginContext
executes pre and post authentication process
based on authentication status.
AMLoginContext
provides a synchronous layer on top of the JAAS
framework for appropriate user interaction and communication between clients
and authentication module via callbacks requirements
AMLoginContext
sets and retrieves the authentication
configuration entry
This class actually starts the JAAS login process by instantiating the
LoginContext
object with the JAAS configuration name and the
CallbackHandler
followed by calling the
LoginContext::login()
method.
Modifier and Type | Field and Description |
---|---|
static AuthThreadManager |
authThread
AuthThreadManager associated with this AMLoginContext.
|
Constructor and Description |
---|
AMLoginContext(AuthContextLocal authContext)
Creates
AMLoginContext object. |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Terminates an ongoing login process.
|
void |
executeLogin(Subject subject,
AuthContext.IndexType loginIndexType,
String loginIndexName,
String locale,
String redirectUrl)
Starts login process, the map passed to this method is the parameters
required to start the login process.
|
String |
getAuthIdentifier()
Returns the current
authIdentifier of the authentication
process as String Session ID. |
String |
getErrorCode()
Returns error code.
|
String |
getErrorMessage()
Returns error message.
|
String |
getErrorTemplate()
Returns error template.
|
String |
getFailureURL()
Returns Login Failure URL for authenticated user.
|
String |
getLockoutMsg()
Gets the account lockout message
|
LoginContext |
getLoginContext()
Returns current login context
|
LoginState |
getLoginState()
Returns login state for the authentication context.
|
Set<String> |
getModuleInstanceNames()
Returns authentication modules configured for a given organization.
|
String |
getOrganizationName()
Returns organization/suborganization for a request.
|
Callback[] |
getRequiredInfo()
Returns array of received callbacks from module.
|
SSOToken |
getSSOToken()
Returns Single Sign On Token for authenticated user, returns null if
session is inactive.
|
int |
getStatus()
Returns the authentication status.
|
Subject |
getSubject()
Returns the subject of authenticated user.
|
String |
getSuccessURL()
Returns Login Success URL for authenticated user.
|
boolean |
isLockedOut()
Checks if the account is locked
|
boolean |
isPureJAAS()
Checks if is pure JAAS mode
|
void |
logout()
Logs out.
|
static void |
resetJAASConfig()
Sets the JAAS configuration to the default container's configuration.
|
void |
runLogin()
Starts the login process ,calls JAAS Login Context
|
Callback[] |
submitCallbackInfo()
CallbackHandler calls this to retrieve the submitted
credentials/callbacks waits till
authContext.getLoginState().setSubmittedCallback is set OR
LoginStatus is not AUTH_IN_PROGRESS . |
void |
submitRequiredInfo(Callback[] callback)
Sets the submitted requirements, called by
AuthContext.submitRequirements
authContext.getLoginState().setSubmittedCallback is update. |
public static AuthThreadManager authThread
public AMLoginContext(AuthContextLocal authContext)
AMLoginContext
object.authContext
- AuthContextLocal
object. Must not be null;public static void resetJAASConfig()
public void executeLogin(Subject subject, AuthContext.IndexType loginIndexType, String loginIndexName, String locale, String redirectUrl) throws AuthLoginException
indexType
, indexName
, principal
,
subject
, password
,
organization name
. Based on these parameters Module
Configuration name is retrieved using Configuration component. Creates
a new LoginContext and starts login process and returns. On error
LoginException is thrown.AuthLoginException
- if execute login failspublic void runLogin()
public void logout() throws AuthLoginException
AuthLoginException
- when fails to logoutpublic Callback[] getRequiredInfo()
public void submitRequiredInfo(Callback[] callback)
AuthContext.submitRequirements
authContext.getLoginState().setSubmittedCallback
is update.callback
- submit the required Callbacks
public Callback[] submitCallbackInfo()
CallbackHandler
calls this to retrieve the submitted
credentials/callbacks waits till
authContext.getLoginState().setSubmittedCallback
is set OR
LoginStatus
is not AUTH_IN_PROGRESS
.public int getStatus()
public LoginState getLoginState()
public void abort() throws AuthLoginException
AuthLoginException
- when fails to abortpublic Set<String> getModuleInstanceNames()
public String getOrganizationName()
public SSOToken getSSOToken()
public String getSuccessURL()
public String getFailureURL()
public String getAuthIdentifier()
authIdentifier
of the authentication
process as String Session ID.authIdentifier
of the authentication process.public Subject getSubject()
public LoginContext getLoginContext()
public String getErrorTemplate()
public String getErrorMessage()
public String getErrorCode()
public String getLockoutMsg()
public boolean isLockedOut()
true
if account is lockedpublic boolean isPureJAAS()
true
if pure JAASCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.