Package org.keycloak.services.managers
Class DefaultBruteForceProtector
- java.lang.Object
- 
- org.keycloak.services.managers.DefaultBruteForceProtector
 
- 
- All Implemented Interfaces:
- Runnable,- Provider,- BruteForceProtector
 
 public class DefaultBruteForceProtector extends Object implements Runnable, BruteForceProtector A single thread will log failures. This is so that we can avoid concurrent writes as we want an accurate failure count- Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classDefaultBruteForceProtector.FailedLoginprotected classDefaultBruteForceProtector.LoginEventprotected classDefaultBruteForceProtector.ShutdownEventprotected classDefaultBruteForceProtector.SuccessfulLogin
 - 
Field SummaryFields Modifier and Type Field Description protected KeycloakSessionFactoryfactoryprotected longfailuresprotected longlastFailureprotected intmaxDeltaTimeSecondsprotected LinkedBlockingQueue<DefaultBruteForceProtector.LoginEvent>queueprotected booleanrunprotected CountDownLatchshutdownLatchprotected longtotalTimestatic intTRANSACTION_SIZE- 
Fields inherited from interface org.keycloak.services.managers.BruteForceProtectorDISABLED_BY_PERMANENT_LOCKOUT
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultBruteForceProtector(KeycloakSessionFactory factory)
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
runprotected volatile boolean run 
 - 
maxDeltaTimeSecondsprotected int maxDeltaTimeSeconds 
 - 
factoryprotected KeycloakSessionFactory factory 
 - 
shutdownLatchprotected CountDownLatch shutdownLatch 
 - 
failuresprotected volatile long failures 
 - 
lastFailureprotected volatile long lastFailure 
 - 
totalTimeprotected volatile long totalTime 
 - 
queueprotected LinkedBlockingQueue<DefaultBruteForceProtector.LoginEvent> queue 
 - 
TRANSACTION_SIZEpublic static final int TRANSACTION_SIZE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
DefaultBruteForceProtectorpublic DefaultBruteForceProtector(KeycloakSessionFactory factory) 
 
- 
 - 
Method Detail- 
failureprotected void failure(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
 - 
getUserModelprotected UserLoginFailureModel getUserModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
 - 
getRealmModelprotected RealmModel getRealmModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
 - 
startpublic void start() 
 - 
shutdownpublic void shutdown() 
 - 
successprotected void success(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
 - 
logFailureprotected void logFailure(DefaultBruteForceProtector.LoginEvent event) 
 - 
failedLoginpublic void failedLogin(RealmModel realm, UserModel user, ClientConnection clientConnection) - Specified by:
- failedLoginin interface- BruteForceProtector
 
 - 
successfulLoginpublic void successfulLogin(RealmModel realm, UserModel user, ClientConnection clientConnection) - Specified by:
- successfulLoginin interface- BruteForceProtector
 
 - 
isTemporarilyDisabledpublic boolean isTemporarilyDisabled(KeycloakSession session, RealmModel realm, UserModel user) - Specified by:
- isTemporarilyDisabledin interface- BruteForceProtector
 
 - 
isPermanentlyLockedOutpublic boolean isPermanentlyLockedOut(KeycloakSession session, RealmModel realm, UserModel user) - Specified by:
- isPermanentlyLockedOutin interface- BruteForceProtector
 
 - 
cleanUpPermanentLockoutpublic void cleanUpPermanentLockout(KeycloakSession session, RealmModel realm, UserModel user) Description copied from interface:BruteForceProtectorClears any remaining traces of the permanent lockout. Does not enable the user as such!- Specified by:
- cleanUpPermanentLockoutin interface- BruteForceProtector
 
 
- 
 
-