public class LoginState extends Object
Modifier and Type | Field and Description |
---|---|
static Set<String> |
INTERNAL_USERS |
boolean |
stateless |
Constructor and Description |
---|
LoginState() |
Modifier and Type | Method and Description |
---|---|
boolean |
activateSession(Subject subject)
Activates session on successful authentication.
|
AMIdentity |
createUserIdentity(String userName,
Map userAttributes,
Set userRoles)
Creates
AMIdentity in the repository. |
void |
enableCookieTimeToLive(boolean flag)
Enables AM session cookie time to live
|
String |
encodeURL(String url)
Returns URL with the cookie value in the URL.
|
String |
encodeURL(String url,
boolean useAMCookie)
Returns URL with the cookie value in the URL.
|
String |
getActivatedSessionTrackingId()
Gets the external ID of the activated session.
|
Map<String,Callback[]> |
getAllReceivedCallbacks()
Get all the received Callbacks.
|
Set<String> |
getAuthenticatedPrincipals()
Returns a list of the authenticated principals in the current authentication process.
|
int |
getAuthLevel()
Returns authentication level.
|
String |
getAuthModuleNames()
Get the auth module name(s).
|
int |
getCacheTime()
Returns session cache time.
|
String |
getClient()
Returns the client address.
|
String |
getClientType()
Returns the client type.
|
String |
getCompositeAdvice()
Returns the Composite Advice for this Authentication request.
|
int |
getCookieTimeToLive()
Returns AM session cookie time to live
|
String |
getErrorCode()
Returns the error code .
|
String |
getErrorMessage()
Returns the error message.
|
String |
getErrorTemplate()
Returns the error template generated by framework.
|
String |
getFailureLoginURL()
Returns failure login URL.
|
String |
getFailureModuleNames()
Gets the failure module names.
|
String |
getFailureTokenId()
SSOToken ID for login failed |
String |
getFileName(String fileName)
Returns the filename .
|
boolean |
getForceFlag() |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns servlet request object.
|
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
Returns servlet response object.
|
int |
getIdleTime()
Returns session idle time.
|
String |
getIndexName()
Returns the index name.
|
AuthContext.IndexType |
getIndexType()
Returns the current index type.
|
boolean |
getInetDomainStatus()
Returns the
inetDomainStatus . |
String |
getInvalidAttemptsDataAttrName()
Return attribute name for storing invalid attempts data
|
String |
getLocale()
Returns locale.
|
String |
getLockoutMsg()
Returns the lockout message.
|
int |
getLoginFailureLockoutCount()
Default count for loginFailureLockout.
|
long |
getLoginFailureLockoutDuration()
Return LoginLockout duration
|
boolean |
getLoginFailureLockoutMode() |
int |
getLoginFailureLockoutMultiplier()
Return multiplier for Memory Lockout
|
boolean |
getLoginFailureLockoutStoreInDS() |
long |
getLoginFailureLockoutTime()
Default max time for loginFailureLockout.
|
String |
getLoginLockoutAttrName()
Return attribute name for LoginLockout
|
String |
getLoginLockoutAttrValue()
Return attribute value for LoginLockout
|
String |
getLoginLockoutNotification()
Default notification for loginFailureLockout.
|
int |
getLoginLockoutUserWarning()
Returns lockout warning message.
|
int |
getLoginStatus()
Returns the authentication login status.
|
String |
getLoginURL()
Returns the Login URL user input.
|
int |
getMaxSession() |
protected String |
getModuleName(String localizedModuleName)
Returns the key for the localized module name.
|
InternalSession |
getOldSession()
Returns old Session
|
String |
getOrgDN()
Returns the organization DN example
o=iplanet.com,o=isp . |
String |
getOrgName()
Returns the organization name.
|
Set<String> |
getPostLoginClassSet()
get orgPostLoginClassSet
|
Callback[] |
getReceivedInfo()
Returns recieved callback info from loginmodule.
|
Map<String,String> |
getRequestParamHash()
Return saved request parameters in
Hashtable |
AMIdentity |
getRole(String roleName)
Returns
AMIdentity object for a Role. |
InternalSession |
getSession()
Returns session, Returns null if session state is
INACTIVE
or DESTROYED . |
Map |
getSharedState()
The shared state map.
|
SessionID |
getSid()
Returns Session ID.
|
SSOToken |
getSSOToken()
Returns the single sign on token associated with the session.
|
Subject |
getSubject()
Returns the authenticated subject.
|
Callback[] |
getSubmittedInfo()
Returns callbacks submitted by client.
|
String |
getSuccessLoginURL()
Returns success login URL.
|
String |
getUserDN()
Returns user DN.
|
String |
getUserDN(AMIdentity amIdentityUser)
Returns user DN of an Identity.
|
String |
getUserIDGeneratorClassName()
Indicates provider class name for userIDGenerator
|
protected String |
getUserToken() |
String |
getUserUniversalId(String userName)
Returns the universal id associated with a user name.
|
X509Certificate |
getX509Certificate(javax.servlet.http.HttpServletRequest servletrequest)
Returns the X509 certificate.
|
ZeroPageLoginConfig |
getZeroPageLoginConfig()
Returns the configuration for whether Zero Page Login (ZPL) should be allowed or not.
|
boolean |
ignoreProfile()
Return ignoreUserProfile
|
void |
incrementFailCount(String failedUserId) |
boolean |
is2faMandatory() |
boolean |
isAccountLocked(String username) |
boolean |
isCookieDetect()
Returns
true |
boolean |
isCookieTimeToLiveEnabled()
Checks whether AM session cookie time to live is enabled
|
boolean |
isDynamicProfileCreationEnabled()
Returns
true if dynamic profile is enabled. |
boolean |
isNoSession() |
boolean |
isSessionUpgrade()
Returns session upgrade.
|
boolean |
isTimedOut()
Returns
true if page times out. |
boolean |
isUserIDGeneratorEnabled()
Indicates userID generate mode is enabled
|
void |
logFailed(String str,
String logId,
boolean appendAuthType,
String error)
Adds log message to authentication error log.
|
void |
logSuccess(String msgId,
String logId)
Adds log message to authentication access log.
|
void |
populateDefaultUserAttributes()
Populate all the default user attribute for profile
|
void |
restoreOldSession()
Restores the old session (if one exists).
|
void |
saveAuthenticatedPrincipal(String principalName)
Saves the principals successfully created in the authentication process whether all modules or identity searches
are successful or not.
|
void |
saveSharedStateAttributes()
Saves the attributes specified by the sharedStateAttributes into requestMap.
|
void |
setAuthLevel(String authLevel)
Sets the authentication level.
|
void |
setCallbacksPerState(String pageState,
Callback[] callbacks)
Sets Callbacks per Page state.
|
void |
setClient(String remoteAddr)
Sets the client address.
|
void |
setCookieDetect(boolean cookieDetect)
Sets the cookie detection value -
true if
cookieSupport is null. |
void |
setCookieTimeToLive(int timeToLive)
Sets AM session cookie time to live
|
void |
setErrorCode(String errorCode)
Sets the error code.
|
void |
setErrorMessage(String errorMessage)
Sets the error message.
|
void |
setErrorTemplate(String errorTemplate)
Sets the error template generated by framework.
|
void |
setFailedUserId(String userID)
Sets the
failureTokenId - set by modules
if this is set the logs will show the user id. |
void |
setFailureLoginURL(String url)
Sets failure login URL.
|
void |
setFailureModuleName(String moduleName)
Adds the failed module name to a set.
|
void |
setForceAuth(boolean force) |
void |
setHttpServletRequest(javax.servlet.http.HttpServletRequest servletRequest)
Sets servlet request.
|
void |
setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
Sets servlet response.
|
void |
setIndexName(String indexName)
Set index name
|
void |
setLocale(String locale)
Sets locale
|
void |
setLockoutMsg(String lockoutMsg)
Sets the lockout message.
|
void |
setLoginStatus(int loginStatus)
Sets the authentication login status.
|
boolean |
setModuleAuthLevel(int authLevel)
Sets the module
AuthLevel . |
void |
setModuleErrorTemplate(String moduleErrorTemplate)
Sets the error module template sent by login module.
|
void |
setOldSession(InternalSession oldSession)
Sets old Session
|
void |
setPageTimeOut(long pageTimeOut)
Sets the page timeout.
|
void |
setParamHash(Map<String,String> requestHash)
Sets the request parameters hash.
|
void |
setReceivedCallback_NoThread(Callback[] callback)
Sets the callbacks recieved and notify waiting thread.
|
void |
setRemoteLocale(String localeStr)
Sets remote locale passed by client
|
void |
setSession(InternalSession sess)
Sets the internal session for the request.
|
void |
setSessionUpgrade(boolean sessionUpgrade)
Sets session upgrade.
|
void |
setSharedState(Map sharedState)
Sets a shared state map from the
AMLoginModule . |
void |
setSubject(Subject subject)
Sets the authenticated subject.
|
void |
setSuccessLoginURL(String url)
Sets success login URL.
|
void |
setSuccessModuleName(String moduleName)
Sets the module name of successful
LoginModule . |
void |
setUserCreationAttributes(Map attributeValuePairs)
Sets a Map of attribute value pairs to be used when the authentication
service is configured to dynamically create a user.
|
void |
setUserName(String username)
Sets userDN - called by
AMLoginContext . |
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
public void setHttpServletRequest(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest
- Servlet request.public InternalSession getSession()
INACTIVE
or DESTROYED
.public void setSession(InternalSession sess)
sess
- Internal session for the request.public void setReceivedCallback_NoThread(Callback[] callback)
callback
- public Callback[] getReceivedInfo()
public Callback[] getSubmittedInfo()
public String getOrgDN()
o=iplanet.com,o=isp
.o=iplanet.com,o=isp
.public String getOrgName()
public int getLoginStatus()
public void setLoginStatus(int loginStatus)
loginStatus
- authentication login status.public void setParamHash(Map<String,String> requestHash)
requestHash
- Request parameters hash.public boolean isDynamicProfileCreationEnabled()
true
if dynamic profile is enabled.true
if dynamic profile is enabled.public String getActivatedSessionTrackingId()
Constants.AM_CTX_ID
public Subject getSubject()
public void setSubject(Subject subject)
subject
- Authenticated subject.public int getIdleTime()
public int getMaxSession()
public int getCacheTime()
public String getUserDN()
public int getAuthLevel()
public void setAuthLevel(String authLevel)
moduleAuthLevel
is set and if
it is greater then the authentications level then
moduleAuthLevel
will be the set level.authLevel
- Authentication Level.public String getClient()
public void setClient(String remoteAddr)
remoteAddr
- Client address.public String getClientType()
public boolean activateSession(Subject subject) throws AuthException
true
.subject
- true
if user session is activated successfully, false if failed to activated
or true
if the noSession parameter is set to true.AuthException
public boolean getInetDomainStatus()
inetDomainStatus
.inetDomainStatus
.public String getLocale()
public void setLocale(String locale)
locale
- locale settingpublic SessionID getSid()
public boolean getForceFlag()
public void setForceAuth(boolean force)
public void enableCookieTimeToLive(boolean flag)
flag
- if true
enables AM session cookie time to live,
otherwise disables AM session cookie time to livepublic boolean isCookieTimeToLiveEnabled()
true
if AM session cookie time to live
is enabled, otherwise returns false
public int getCookieTimeToLive()
public void setCookieTimeToLive(int timeToLive)
timeToLive
- AM session cookie time to live in secondspublic SSOToken getSSOToken() throws SSOException
SSOException
public String encodeURL(String url)
url
- URL.public String encodeURL(String url, boolean useAMCookie)
public String getFileName(String fileName)
fileRoot_locale/orgPath/filePath/filename fileRoot/orgPath/filePath/filename default_locale/orgPath/filePath/filename default/orgPath/filePath/filename where filePath = clientPath (html/wml etc) + serviceName eg. if orgDN = o=solaris.eng,o=eng.com,o=sun.com,dc=iplanet,dc=com clientPath = html service name = paycheck locale=en filename=Login.jspthen the search will be as follows :
iplanet_en/sun.com/eng.com/solaris.eng/html/paycheck/Login.jsp iplanet_en/sun.com/eng.com/solaris.eng/html/Login.jsp iplanet_en/sun.com/eng.com/solaris.eng/Login.jsp iplanet_en/sun.com/eng.com/html/paycheck/Login.jsp iplanet_en/sun.com/eng.com/html/Login.jsp iplanet_en/sun.com/eng.com/Login.jsp iplanet_en/sun.com/html/paycheck/Login.jsp iplanet_en/sun.com/html/Login.jsp iplanet_en/sun.com/Login.jsp iplanet_en/html/paycheck/Login.jsp iplanet_en/html/Login.jsp iplanet_en/Login.jsp iplanet/sun.com/eng.com/solaris.eng/html/paycheck/Login.jsp iplanet/sun.com/eng.com/solaris.eng/html/Login.jsp iplanet/sun.com/eng.com/solaris.eng/Login.jsp iplanet/sun.com/eng.com/html/paycheck/Login.jsp iplanet/sun.com/eng.com/html/Login.jsp iplanet/sun.com/eng.com/Login.jsp iplanet/sun.com/html/paycheck/Login.jsp iplanet/sun.com/html/Login.jsp iplanet/sun.com/Login.jsp iplanet/html/paycheck/Login.jsp iplanet/html/Login.jsp iplanet/Login.jsp default_en/sun.com/eng.com/solaris.eng/html/paycheck/Login.jsp default_en/sun.com/eng.com/solaris.eng/html/Login.jsp default_en/sun.com/eng.com/solaris.eng/Login.jsp default_en/sun.com/eng.com/html/paycheck/Login.jsp default_en/sun.com/eng.com/html/Login.jsp default_en/sun.com/eng.com/Login.jsp default_en/sun.com/html/paycheck/Login.jsp default_en/sun.com/html/Login.jsp default_en/sun.com/Login.jsp default_en/html/paycheck/Login.jsp default_en/html/Login.jsp default_en/Login.jsp default/sun.com/eng.com/solaris.eng/html/paycheck/Login.jsp default/sun.com/eng.com/solaris.eng/html/Login.jsp default/sun.com/eng.com/solaris.eng/Login.jsp default/sun.com/eng.com/html/paycheck/Login.jsp default/sun.com/eng.com/html/Login.jsp default/sun.com/eng.com/Login.jsp default/sun.com/html/paycheck/Login.jsp default/sun.com/html/Login.jsp default/sun.com/Login.jsp default/html/paycheck/Login.jsp default/html/Login.jsp default/Login.jspIn case of non-HTML client, it will try to find
Login_<charset>.jsp
.
If not found, it then try public void populateDefaultUserAttributes() throws AMException
AMException
- if it fails to populate default user attributespublic String getAuthModuleNames()
public ZeroPageLoginConfig getZeroPageLoginConfig()
public Map<String,String> getRequestParamHash()
Hashtable
Hashtable
public AuthContext.IndexType getIndexType()
public String getSuccessLoginURL()
public void setSuccessLoginURL(String url)
url
- success login URL.public String getFailureLoginURL()
public void setFailureLoginURL(String url)
url
- failure login URL.public javax.servlet.http.HttpServletResponse getHttpServletResponse()
public void setHttpServletResponse(javax.servlet.http.HttpServletResponse servletResponse)
servletResponse
- servletResponse object to be setpublic boolean isNoSession()
true
if noSession mode was enabled in the request.protected String getUserToken()
public boolean getLoginFailureLockoutMode()
public boolean getLoginFailureLockoutStoreInDS()
public long getLoginFailureLockoutTime()
public int getLoginFailureLockoutCount()
public String getLoginLockoutNotification()
public void incrementFailCount(String failedUserId)
public boolean isAccountLocked(String username)
public int getLoginLockoutUserWarning()
public String getErrorCode()
public void setErrorCode(String errorCode)
errorCode
- Error code.public String getErrorMessage()
public void setErrorMessage(String errorMessage)
errorMessage
- Error message.public String getErrorTemplate()
public void setErrorTemplate(String errorTemplate)
errorTemplate
- Error template.public void setModuleErrorTemplate(String moduleErrorTemplate)
moduleErrorTemplate
- Module error template.public boolean isTimedOut()
true
if page times out.true
if page times out.public String getLockoutMsg()
public void setLockoutMsg(String lockoutMsg)
lockoutMsg
- the lockout message.public String getIndexName()
public void setIndexName(String indexName)
indexName
- indexName to be setpublic boolean setModuleAuthLevel(int authLevel)
AuthLevel
.
The authentication level being set cannot be downgraded
below that set by the module configuration.This method
is called by AMLoginModule
SPIauthLevel
- authentication level string to be settrue
if setting is successful, false otherwisepublic X509Certificate getX509Certificate(javax.servlet.http.HttpServletRequest servletrequest)
public void logSuccess(String msgId, String logId)
msgId
- I18n key of the localized message.logId
- Logging message Idpublic void logFailed(String str, String logId, boolean appendAuthType, String error)
str
- localized message to be logged.logId
- logging message Id.appendAuthType
- if true, append authentication type to the logId
to form new logging message Id. for example:
"LOGIN_FAILED_LEVEL".error
- error Id to be append to logId to form new logging
message Id. for example : "LOGIN_FAILED_LEVEL_INVALIDPASSWORD"public String getLoginLockoutAttrName()
public String getLoginLockoutAttrValue()
public String getInvalidAttemptsDataAttrName()
public long getLoginFailureLockoutDuration()
public int getLoginFailureLockoutMultiplier()
public InternalSession getOldSession()
public void setOldSession(InternalSession oldSession)
oldSession
- Old InternalSession Objectpublic boolean isSessionUpgrade()
public void setSessionUpgrade(boolean sessionUpgrade)
sessionUpgrade
- true
if session upgrade.public String getLoginURL()
public void setPageTimeOut(long pageTimeOut)
pageTimeOut
- Page timeout.public boolean ignoreProfile()
public void setFailedUserId(String userID)
failureTokenId
- set by modules
if this is set the logs will show the user id.userID
- User ID.public Map<String,Callback[]> getAllReceivedCallbacks()
public void setCallbacksPerState(String pageState, Callback[] callbacks)
public boolean isCookieDetect()
true if cookie detected.
true if cookie detected.
public void setCookieDetect(boolean cookieDetect)
true
if
cookieSupport
is null.cookieDetect
- Cookie Detect flag.public void setUserCreationAttributes(Map attributeValuePairs)
attributeValuePairs
- Map of attribute name to a set of values.public void setSuccessModuleName(String moduleName)
LoginModule
.
This module name will be populated in the session property
AuthType
.moduleName
- Name of module.public void setFailureModuleName(String moduleName)
moduleName
- Failed module name.public String getFailureModuleNames()
protected String getModuleName(String localizedModuleName)
localizedModuleName
- , the localized module namepublic void setRemoteLocale(String localeStr)
localeStr
- remote client locale string.public AMIdentity getRole(String roleName) throws AuthException
AMIdentity
object for a Role.roleName
- role name.AMIdentity
object.AuthException
public String getUserDN(AMIdentity amIdentityUser)
amIdentityUser
- AMIdentity
object.public AMIdentity createUserIdentity(String userName, Map userAttributes, Set userRoles) throws IdRepoException, SSOException
AMIdentity
in the repository.userName
- name of user to be created.userAttributes
- Map of default attributes.userRoles
- Set of default roles.AMIdentity
object of created user.IdRepoException
- if it fails to create AMIdentity
SSOException
- if SSOToken
for admin is not validpublic String getUserUniversalId(String userName)
userName
- name of user to be created.public String getCompositeAdvice()
public void setUserName(String username)
AMLoginContext
.public void restoreOldSession()
public boolean isUserIDGeneratorEnabled()
public String getUserIDGeneratorClassName()
public String getFailureTokenId()
SSOToken
ID for login failedpublic boolean is2faMandatory()
public void setSharedState(Map sharedState)
AMLoginModule
.sharedState
- public Map getSharedState()
public void saveSharedStateAttributes()
public void saveAuthenticatedPrincipal(String principalName)
principalName
- public Set<String> getAuthenticatedPrincipals()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.