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 Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected KeycloakSessionFactoryprotected longprotected longprotected intprotected booleanprotected CountDownLatchprotected longstatic final intFields inherited from interface org.keycloak.services.managers.BruteForceProtector
DISABLED_BY_PERMANENT_LOCKOUT -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
run
protected volatile boolean run -
maxDeltaTimeSeconds
protected int maxDeltaTimeSeconds -
factory
-
shutdownLatch
-
failures
protected volatile long failures -
lastFailure
protected volatile long lastFailure -
totalTime
protected volatile long totalTime -
queue
-
TRANSACTION_SIZE
public static final int TRANSACTION_SIZE- See Also:
-
-
Constructor Details
-
DefaultBruteForceProtector
-
-
Method Details
-
failure
-
getUserModel
protected UserLoginFailureModel getUserModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) -
getRealmModel
protected RealmModel getRealmModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event) -
start
public void start() -
shutdown
public void shutdown() -
run
public void run() -
success
-
logFailure
-
failedLogin
- Specified by:
failedLoginin interfaceBruteForceProtector
-
successfulLogin
- Specified by:
successfulLoginin interfaceBruteForceProtector
-
isTemporarilyDisabled
- Specified by:
isTemporarilyDisabledin interfaceBruteForceProtector
-
isPermanentlyLockedOut
- Specified by:
isPermanentlyLockedOutin interfaceBruteForceProtector
-
cleanUpPermanentLockout
Description copied from interface:BruteForceProtectorClears any remaining traces of the permanent lockout. Does not enable the user as such!- Specified by:
cleanUpPermanentLockoutin interfaceBruteForceProtector
-
close
public void close()
-