Package org.forgerock.openam.examples
Class SampleAuth
- java.lang.Object
-
- com.sun.identity.authentication.spi.AMLoginModule
-
- org.forgerock.openam.examples.SampleAuth
-
- All Implemented Interfaces:
LoginModule
public class SampleAuth extends AMLoginModule
SampleAuth authentication module example. If you create your own module based on this example, you must modify all occurrences of "SampleAuth" in addition to changing the name of the class. Please refer to OpenAM documentation for further information. Feel free to look at the code for authentication modules delivered with OpenAM, as they implement this same API.
-
-
Field Summary
-
Fields inherited from class com.sun.identity.authentication.spi.AMLoginModule
amCache, auditor, currentState
-
-
Constructor Summary
Constructors Constructor Description SampleAuth()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrincipalgetPrincipal()Abstract method must be implemeted by each login module to get the user Principalvoidinit(Subject subject, Map sharedState, Map options)This method stores service attributes and localized properties for later use.intprocess(Callback[] callbacks, int state)Abstract method must be implemented by each login module to control the flow of the login process.-
Methods inherited from class com.sun.identity.authentication.spi.AMLoginModule
abort, clearInfoText, commit, createIdentity, destroyModuleState, 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, nullifyUsedVars, 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)
This method stores service attributes and localized properties for later use.- Specified by:
initin classAMLoginModule- Parameters:
subject- the subject being authenticatedsharedState- the state shared between authentication modulesoptions- the configuration options for this authentication module
-
process
public int process(Callback[] callbacks, int state) throws LoginException
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:
LoginException- if login fails.
-
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
-
-