Package org.keycloak.policy
Class BlacklistPasswordPolicyProvider
java.lang.Object
org.keycloak.policy.BlacklistPasswordPolicyProvider
- All Implemented Interfaces:
PasswordPolicyProvider
,Provider
Checks a password against a configured password blacklist.
- Author:
- Thomas Darimont
-
Field Summary
Fields inherited from interface org.keycloak.policy.PasswordPolicyProvider
INT_CONFIG_TYPE, STRING_CONFIG_TYPE
-
Constructor Summary
ConstructorDescriptionBlacklistPasswordPolicyProvider
(KeycloakContext context, BlacklistPasswordPolicyProviderFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
parseConfig
(String blacklistName) Parses the allowed configuration for aBlacklistPasswordPolicyProvider
.Checks whether the provided password is contained in the configured blacklist.validate
(RealmModel realm, UserModel user, String password) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.policy.PasswordPolicyProvider
parseInteger
-
Field Details
-
ERROR_MESSAGE
- See Also:
-
-
Constructor Details
-
BlacklistPasswordPolicyProvider
public BlacklistPasswordPolicyProvider(KeycloakContext context, BlacklistPasswordPolicyProviderFactory factory)
-
-
Method Details
-
validate
Checks whether the provided password is contained in the configured blacklist.- Specified by:
validate
in interfacePasswordPolicyProvider
- Parameters:
username
-password
-- Returns:
- null if the password is not blacklisted otherwise a
PolicyError
-
validate
- Specified by:
validate
in interfacePasswordPolicyProvider
-
parseConfig
Parses the allowed configuration for aBlacklistPasswordPolicyProvider
. Supported syntax is {@¢ode passwordBlacklist(fileName)} Example configurations:passwordBlacklist(test-password-blacklist.txt)
- Specified by:
parseConfig
in interfacePasswordPolicyProvider
- Parameters:
blacklistName
-- Returns:
-
close
public void close()
-