Package de.xima.fc.security.cache
Class LoginAttemptHelper
- java.lang.Object
- 
- de.xima.fc.security.cache.LoginAttemptHelper
 
- 
 public class LoginAttemptHelper extends Object Helper for storing / removing user login attempts and checking the user login state.- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static LoginAttemptaddFailedLoginAttempt(String loginId)static <PROFILE> PROFILEattemptLogin(String username, String password, ILoginMethod<PROFILE> loginMethod)Attempts to login with the given username and password.static ELoginStatecheckLoginAttempts(UserProfile profile)static ELoginStatecheckLoginAttempts(String loginId)static intgetLockCount()static longgetLockDuration()static longgetLoginAttemptCount(String loginId)static LoginAttemptgetLoginAttempts(String loginId)static intgetMaxLockCount()static voidremoveLoginAttempts(UserProfile profile)static LoginAttemptremoveLoginAttempts(String loginId)static LoginAttemptsetFailedLoginAttempts(String loginId, long count)
 
- 
- 
- 
Method Detail- 
checkLoginAttemptspublic static ELoginState checkLoginAttempts(UserProfile profile) 
 - 
checkLoginAttemptspublic static ELoginState checkLoginAttempts(String loginId) 
 - 
getLoginAttemptspublic static LoginAttempt getLoginAttempts(String loginId) 
 - 
getLoginAttemptCountpublic static long getLoginAttemptCount(String loginId) 
 - 
removeLoginAttemptspublic static void removeLoginAttempts(UserProfile profile) 
 - 
removeLoginAttemptspublic static LoginAttempt removeLoginAttempts(String loginId) 
 - 
addFailedLoginAttemptpublic static LoginAttempt addFailedLoginAttempt(String loginId) 
 - 
setFailedLoginAttemptspublic static LoginAttempt setFailedLoginAttempts(String loginId, long count) 
 - 
getLockDurationpublic static long getLockDuration() 
 - 
getLockCountpublic static int getLockCount() 
 - 
getMaxLockCountpublic static int getMaxLockCount() 
 - 
attemptLoginpublic static <PROFILE> PROFILE attemptLogin(String username, String password, ILoginMethod<PROFILE> loginMethod) throws org.pac4j.core.exception.TechnicalException Attempts to login with the given username and password. The login attempts are checked and incremented or cleared accordingly.- Type Parameters:
- PROFILE- Type of the user profile returned when the user was logged in..
- Parameters:
- username- Username for the login.
- password- Password for the login.
- loginMethod- Login implementation.
- Returns:
- The user profile if the login succeeded.
- Throws:
- org.pac4j.core.exception.TechnicalException- When the login failed, such as when the user is unauthorized.
 
 
- 
 
-