Class Adaptive
- java.lang.Object
-
- com.sun.identity.authentication.spi.AMLoginModule
-
- org.forgerock.openam.authentication.modules.adaptive.Adaptive
-
- All Implemented Interfaces:
LoginModule
public class Adaptive extends AMLoginModule
-
-
Field Summary
-
Fields inherited from class com.sun.identity.authentication.spi.AMLoginModule
amCache, auditor, currentState
-
-
Constructor Summary
Constructors Constructor Description Adaptive()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcheckAuthFailure()Check to see if there have been any auth failures since last successful login.protected intcheckGeoLocation()protected intcheckIPHistory()Check to see if the IP address being used is in the clients history IPHistory is stored in a single attribute, separated by "|" If the client IP is new, (Not seen before) then add it to front of list, and drop from end of list.protected intcheckIPRange()Check to see if the IP address is within the ranges specified Range can be in the form of: x.x.x.x/YY or x.x.x.x-y.y.y.y.protected intcheckKnownCookie()Check to see if the client has a cookie with optional valueprotected intcheckLastLogin()Check to see if the last login is within the allowed range Last login is stored in a cookie in encrypted formatprotected intcheckRegisteredClient()Check to see if the client has a cookie with optional valueprotected intcheckRequestHeader()Check to see if the client has a cookie with optional valueprotected intcheckRiskAttribute()Check to see if the user profile has a risk attribute with valueprotected intcheckTimeDay()Check to see if current time is within rangevoiddestroyModuleState()This method should be overridden by each login module to destroy dispensable state fields.protected booleangetOptionAsBoolean(Map m, String i)protected intgetOptionAsInteger(Map m, String i)PrincipalgetPrincipal()Abstract method must be implemeted by each login module to get the user Principalvoidinit(Subject subject, Map sharedState, Map options)Initialize this LoginModule.static StringmapToString(Map<String,String> map)voidnullifyUsedVars()This method should be overridden by each login module to do some garbage collection work after the module process is done.intprocess(Callback[] callbacks, int state)Abstract method must be implemented by each login module to control the flow of the login process.protected voidsetPostAuthNParams()This builds a map, of the data needed by the PostAuth Class, serializes it, and then adds it to the Sessionstatic Map<String,String>stringToMap(String input)-
Methods inherited from class com.sun.identity.authentication.spi.AMLoginModule
abort, clearInfoText, commit, createIdentity, forceCallbacksInit, getAMIdentityRepository, getAttribute, getAuditEntryDetail, getAuthenticatedPrincipals, getAuthLevel, getCallback, getCallback, getCallbackHandler, getCurrentState, getFailCount, getHttpServletRequest, getHttpServletResponse, getInfoText, getLocale, getLoginLocale, getLoginState, getMaximumFailCount, getNewUserIDs, getNumberOfStates, getOrgProfile, getOrgServiceTemplate, getPwdKey, getRequestOrg, getServiceConfig, getSessionId, getSSOSession, getUserAliasList, getUserKey, getUserProfile, getUserSessionProperty, getUserSessions, incrementFailCount, initialize, isAccountLocked, isDynamicProfileCreationEnabled, isRequired, isSessionQuotaReached, isSharedStateEnabled, isSuperAdmin, isUseFirstPassEnabled, isValidUserEntry, login, logout, replaceCallback, replaceHeader, resetCallback, resetCurrentState, setAuthLevel, setFailureID, setForceCallbacksRead, setLoginFailureURL, setLoginSuccessURL, setModuleErrorTemplate, setOrg, setSharedStateEnabled, setUserAttributes, setUserSessionProperty, storeUsername, storeUsernamePasswd, substituteHeader, substituteInfoText, validatePassword, validateUserName
-
-
-
-
Method Detail
-
init
public void init(Subject subject, Map sharedState, Map options)
Description copied from class:AMLoginModuleInitialize this LoginModule.This is an abstract method, must be implemented by user's Login Module to initialize this LoginModule with the relevant information. If this LoginModule does not understand any of the data stored in sharedState or options parameters, they can be ignored.
- Specified by:
initin classAMLoginModule- Parameters:
subject- - the Subject to be authenticated.sharedState- - state shared with other configured LoginModules.options- - options specified in the login Configuration for this particular LoginModule. It contains all the global and organization attribute configuration for this module. The key of the map is the attribute name (e.g.iplanet-am-auth-ldap-server) as String, the value is the value of the corresponding attribute as Set.
-
process
public int process(Callback[] callbacks, int state) throws AuthLoginException
Description copied from class:AMLoginModuleAbstract method must be implemented by each login module to control the flow of the login process.This method takes an array of sbumitted Callback, process them and decide the order of next state to go. Return -1 if the login is successful, return 0 if the LoginModule should be ignored.
- Specified by:
processin classAMLoginModule- Parameters:
callbacks- Callback[] for this Login statestate- Order of state. State order starts with 1.- Returns:
- order of next state. return -1 if authentication is successful, return 0 if the LoginModule should be ignored.
- Throws:
AuthLoginException
-
getPrincipal
public Principal getPrincipal()
Description copied from class:AMLoginModuleAbstract method must be implemeted by each login module to get the user Principal- Specified by:
getPrincipalin classAMLoginModule- Returns:
- Principal
-
checkAuthFailure
protected int checkAuthFailure()
Check to see if there have been any auth failures since last successful login. This relies on the Auth Failure framework with Account Lockout enabled. Post_Auth_Class: Should failure count be reset if successful? Returns authFailScore if AuthFailure- Returns:
- score achieved with this test
-
checkIPRange
protected int checkIPRange()
Check to see if the IP address is within the ranges specified Range can be in the form of: x.x.x.x/YY or x.x.x.x-y.y.y.y. or x:x:x:x:x:x:x:x/YY or x:x:x:x:x:x:x:x-y:y:y:y:y:y:y:y There can be multiple ranges passed in- Returns:
- score achieved with this test
-
checkIPHistory
protected int checkIPHistory()
Check to see if the IP address being used is in the clients history IPHistory is stored in a single attribute, separated by "|" If the client IP is new, (Not seen before) then add it to front of list, and drop from end of list. The PostAuthN Method will update the profile if needed.- Returns:
- score achieved with this test
-
checkGeoLocation
protected int checkGeoLocation()
-
checkKnownCookie
protected int checkKnownCookie()
Check to see if the client has a cookie with optional value- Returns:
- score achieved with this test
-
checkRequestHeader
protected int checkRequestHeader()
Check to see if the client has a cookie with optional value- Returns:
- score achieved with this test
-
checkRegisteredClient
protected int checkRegisteredClient()
Check to see if the client has a cookie with optional value- Returns:
- score achieved with this test
-
checkTimeDay
protected int checkTimeDay()
Check to see if current time is within range- Returns:
- score achieved with this test
-
checkLastLogin
protected int checkLastLogin()
Check to see if the last login is within the allowed range Last login is stored in a cookie in encrypted format- Returns:
- score achieved with this test
-
checkRiskAttribute
protected int checkRiskAttribute()
Check to see if the user profile has a risk attribute with value- Returns:
- score achieved with this test
-
setPostAuthNParams
protected void setPostAuthNParams()
This builds a map, of the data needed by the PostAuth Class, serializes it, and then adds it to the Session
-
destroyModuleState
public void destroyModuleState()
Description copied from class:AMLoginModuleThis method should be overridden by each login module to destroy dispensable state fields.- Overrides:
destroyModuleStatein classAMLoginModule
-
nullifyUsedVars
public void nullifyUsedVars()
Description copied from class:AMLoginModuleThis method should be overridden by each login module to do some garbage collection work after the module process is done. Typically those class wide global variables that will not be used again until a logout call should be nullified.- Overrides:
nullifyUsedVarsin classAMLoginModule
-
-