Package org.keycloak.policy
Class BlacklistPasswordPolicyProvider
- java.lang.Object
-
- org.keycloak.policy.BlacklistPasswordPolicyProvider
-
- All Implemented Interfaces:
PasswordPolicyProvider,Provider
public class BlacklistPasswordPolicyProvider extends Object implements PasswordPolicyProvider
Checks a password against a configured password blacklist.- Author:
- Thomas Darimont
-
-
Field Summary
Fields Modifier and Type Field Description static StringERROR_MESSAGE-
Fields inherited from interface org.keycloak.policy.PasswordPolicyProvider
INT_CONFIG_TYPE, STRING_CONFIG_TYPE
-
-
Constructor Summary
Constructors Constructor Description BlacklistPasswordPolicyProvider(KeycloakContext context, BlacklistPasswordPolicyProviderFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ObjectparseConfig(String blacklistName)PolicyErrorvalidate(String username, String password)Checks whether the provided password is contained in the configured blacklist.PolicyErrorvalidate(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 Detail
-
ERROR_MESSAGE
public static final String ERROR_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BlacklistPasswordPolicyProvider
public BlacklistPasswordPolicyProvider(KeycloakContext context, BlacklistPasswordPolicyProviderFactory factory)
-
-
Method Detail
-
validate
public PolicyError validate(String username, String password)
Checks whether the provided password is contained in the configured blacklist.- Specified by:
validatein interfacePasswordPolicyProvider- Parameters:
username-password-- Returns:
- null if the password is not blacklisted otherwise a
PolicyError
-
validate
public PolicyError validate(RealmModel realm, UserModel user, String password)
- Specified by:
validatein interfacePasswordPolicyProvider
-
parseConfig
public Object parseConfig(String blacklistName)
- Specified by:
parseConfigin interfacePasswordPolicyProvider
-
-