diff --git a/server-spi-private/src/main/java/org/keycloak/policy/BlacklistPasswordPolicyProvider.java b/server-spi-private/src/main/java/org/keycloak/policy/BlacklistPasswordPolicyProvider.java index f114c24c6c..4ade2151f5 100644 --- a/server-spi-private/src/main/java/org/keycloak/policy/BlacklistPasswordPolicyProvider.java +++ b/server-spi-private/src/main/java/org/keycloak/policy/BlacklistPasswordPolicyProvider.java @@ -45,7 +45,7 @@ public class BlacklistPasswordPolicyProvider implements PasswordPolicyProvider { PasswordBlacklist blacklist = (FileBasedPasswordBlacklist) policyConfig; - if (!blacklist.contains(password)) { + if (!blacklist.contains(password.toLowerCase())) { return null; } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/policy/PasswordPolicyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/policy/PasswordPolicyTest.java index 0be8d19fcc..2e7c5f73d9 100755 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/policy/PasswordPolicyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/policy/PasswordPolicyTest.java @@ -154,6 +154,7 @@ public class PasswordPolicyTest extends AbstractKeycloakTest { Assert.assertEquals(BlacklistPasswordPolicyProvider.ERROR_MESSAGE, policyManager.validate("jdoe", "blacklisted1").getMessage()); Assert.assertEquals(BlacklistPasswordPolicyProvider.ERROR_MESSAGE, policyManager.validate("jdoe", "blacklisted2").getMessage()); + Assert.assertEquals(BlacklistPasswordPolicyProvider.ERROR_MESSAGE, policyManager.validate("jdoe", "bLaCkLiSteD2").getMessage()); assertNull(policyManager.validate("jdoe", "notblacklisted")); }); }