reset defaults
This commit is contained in:
parent
003f27e9bd
commit
a27097e9ef
1 changed files with 28 additions and 0 deletions
|
@ -81,11 +81,39 @@ public class BruteForceTest extends AbstractTestRealmKeycloakTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void config() {
|
public void config() {
|
||||||
|
try {
|
||||||
|
clearUserFailures();
|
||||||
|
clearAllUserFailures();
|
||||||
|
RealmRepresentation realm = adminClient.realm("test").toRepresentation();
|
||||||
|
realm.setFailureFactor(2);
|
||||||
|
realm.setMaxDeltaTimeSeconds(200);
|
||||||
|
realm.setMaxFailureWaitSeconds(1000);
|
||||||
|
realm.setWaitIncrementSeconds(50);
|
||||||
|
adminClient.realm("test").update(realm);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
events.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void slowItDown() throws Exception {
|
public void slowItDown() throws Exception {
|
||||||
|
try {
|
||||||
|
clearUserFailures();
|
||||||
|
clearAllUserFailures();
|
||||||
|
RealmRepresentation realm = adminClient.realm("test").toRepresentation();
|
||||||
|
realm.setMaxFailureWaitSeconds(900);
|
||||||
|
realm.setMinimumQuickLoginWaitSeconds(60);
|
||||||
|
realm.setWaitIncrementSeconds(60);
|
||||||
|
realm.setQuickLoginCheckMilliSeconds(1000L);
|
||||||
|
realm.setMaxDeltaTimeSeconds(60 * 60 * 12); // 12 hours
|
||||||
|
realm.setFailureFactor(30);
|
||||||
|
adminClient.realm("test").update(realm);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
events.clear();
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue