Package org.keycloak.services.managers
Class DefaultBruteForceProtector
java.lang.Object
org.keycloak.services.managers.DefaultBruteForceProtector
- All Implemented Interfaces:
- Runnable,- Provider,- 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 ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected KeycloakSessionFactoryprotected longprotected longprotected intprotected booleanprotected CountDownLatchprotected longstatic final intFields inherited from interface org.keycloak.services.managers.BruteForceProtectorDISABLED_BY_PERMANENT_LOCKOUT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanUpPermanentLockout(KeycloakSession session, RealmModel realm, UserModel user) Clears any remaining traces of the permanent lockout.voidclose()voidfailedLogin(RealmModel realm, UserModel user, ClientConnection clientConnection) protected voidfailure(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) protected RealmModelgetRealmModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) protected UserLoginFailureModelgetUserModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) booleanisPermanentlyLockedOut(KeycloakSession session, RealmModel realm, UserModel user) booleanisTemporarilyDisabled(KeycloakSession session, RealmModel realm, UserModel user) protected voidvoidrun()voidshutdown()voidstart()protected voidsuccess(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) voidsuccessfulLogin(RealmModel realm, UserModel user, ClientConnection clientConnection) 
- 
Field Details- 
runprotected volatile boolean run
- 
maxDeltaTimeSecondsprotected int maxDeltaTimeSeconds
- 
factory
- 
shutdownLatch
- 
failuresprotected volatile long failures
- 
lastFailureprotected volatile long lastFailure
- 
totalTimeprotected volatile long totalTime
- 
queue
- 
TRANSACTION_SIZEpublic static final int TRANSACTION_SIZE- See Also:
 
 
- 
- 
Constructor Details- 
DefaultBruteForceProtector
 
- 
- 
Method Details- 
failure
- 
getUserModelprotected UserLoginFailureModel getUserModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
- 
getRealmModelprotected RealmModel getRealmModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) 
- 
startpublic void start()
- 
shutdownpublic void shutdown()
- 
runpublic void run()
- 
success
- 
logFailure
- 
failedLogin- Specified by:
- failedLoginin interface- BruteForceProtector
 
- 
successfulLogin- Specified by:
- successfulLoginin interface- BruteForceProtector
 
- 
isTemporarilyDisabled- Specified by:
- isTemporarilyDisabledin interface- BruteForceProtector
 
- 
isPermanentlyLockedOut- Specified by:
- isPermanentlyLockedOutin interface- BruteForceProtector
 
- 
cleanUpPermanentLockoutDescription copied from interface:BruteForceProtectorClears any remaining traces of the permanent lockout. Does not enable the user as such!- Specified by:
- cleanUpPermanentLockoutin interface- BruteForceProtector
 
- 
closepublic void close()
 
-