public class DefaultBruteForceProtector extends Object implements Runnable, BruteForceProtector
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultBruteForceProtector.FailedLogin |
protected class |
DefaultBruteForceProtector.LoginEvent |
protected class |
DefaultBruteForceProtector.ShutdownEvent |
protected class |
DefaultBruteForceProtector.SuccessfulLogin |
Modifier and Type | Field and Description |
---|---|
protected KeycloakSessionFactory |
factory |
protected long |
failures |
protected long |
lastFailure |
protected int |
maxDeltaTimeSeconds |
protected LinkedBlockingQueue<DefaultBruteForceProtector.LoginEvent> |
queue |
protected boolean |
run |
protected CountDownLatch |
shutdownLatch |
protected long |
totalTime |
static int |
TRANSACTION_SIZE |
Constructor and Description |
---|
DefaultBruteForceProtector(KeycloakSessionFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
failedLogin(RealmModel realm,
UserModel user,
ClientConnection clientConnection) |
void |
failure(KeycloakSession session,
DefaultBruteForceProtector.LoginEvent event) |
protected RealmModel |
getRealmModel(KeycloakSession session,
DefaultBruteForceProtector.LoginEvent event) |
protected UserLoginFailureModel |
getUserModel(KeycloakSession session,
DefaultBruteForceProtector.LoginEvent event) |
boolean |
isTemporarilyDisabled(KeycloakSession session,
RealmModel realm,
UserModel user) |
protected void |
logFailure(DefaultBruteForceProtector.LoginEvent event) |
void |
run() |
void |
shutdown() |
void |
start() |
void |
successfulLogin(RealmModel realm,
UserModel user,
ClientConnection clientConnection) |
protected volatile boolean run
protected int maxDeltaTimeSeconds
protected KeycloakSessionFactory factory
protected CountDownLatch shutdownLatch
protected volatile long failures
protected volatile long lastFailure
protected volatile long totalTime
protected LinkedBlockingQueue<DefaultBruteForceProtector.LoginEvent> queue
public static final int TRANSACTION_SIZE
public DefaultBruteForceProtector(KeycloakSessionFactory factory)
public void failure(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event)
protected UserLoginFailureModel getUserModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event)
protected RealmModel getRealmModel(KeycloakSession session, DefaultBruteForceProtector.LoginEvent event)
public void start()
public void shutdown()
protected void logFailure(DefaultBruteForceProtector.LoginEvent event)
public void failedLogin(RealmModel realm, UserModel user, ClientConnection clientConnection)
failedLogin
in interface BruteForceProtector
public void successfulLogin(RealmModel realm, UserModel user, ClientConnection clientConnection)
successfulLogin
in interface BruteForceProtector
public boolean isTemporarilyDisabled(KeycloakSession session, RealmModel realm, UserModel user)
isTemporarilyDisabled
in interface BruteForceProtector
Copyright © 2020 JBoss by Red Hat. All rights reserved.