From 5d8f449ea05eb52bffbdc842b9308371530951b3 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Sat, 11 Nov 2017 21:37:35 +0100 Subject: [PATCH] KEYCLOAK-5840 Remove unused config map in AddUser command The only value put into this config map is the password hash iterations count. But `iterations` is used directly with the hashProvider. See: https://lgtm.com/projects/g/keycloak/keycloak/snapshot/73c82d296e70e09343f6f55eeea56a085075b289/files/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java?sort=name&dir=ASC&mode=heatmap&excluded=false#x490b537b199a8415:1 --- .../main/java/org/keycloak/wildfly/adduser/AddUser.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java b/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java index 048b3847e8..4a7c9a1256 100644 --- a/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java +++ b/wildfly/adduser/src/main/java/org/keycloak/wildfly/adduser/AddUser.java @@ -32,7 +32,6 @@ import org.keycloak.common.util.Base64; import org.keycloak.credential.CredentialModel; import org.keycloak.credential.hash.PasswordHashProvider; import org.keycloak.credential.hash.PasswordHashProviderFactory; -import org.keycloak.credential.hash.Pbkdf2PasswordHashProviderFactory; import org.keycloak.models.PasswordPolicy; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.representations.idm.RealmRepresentation; @@ -47,7 +46,6 @@ import java.lang.reflect.Method; import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.ServiceLoader; /** @@ -158,11 +156,6 @@ public class AddUser { user.setUsername(userName); user.setCredentials(new LinkedList()); - Map config = new HashMap<>(); - if (iterations > 0) { - config.put("hashIterations", iterations); - } - PasswordHashProviderFactory hashProviderFactory = getHashProviderFactory(DEFAULT_HASH_ALGORITH); PasswordHashProvider hashProvider = hashProviderFactory.create(null);