diff --git a/.gitignore b/.gitignore index 2d79ada..935efc3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,5 @@ hs_err_pid* /target/* /plugin/* .settings/* -.project \ No newline at end of file +.project +/target/ diff --git a/src/main/java/org/keycloak/plugin/rhmi/DelayAuthentication.java b/src/main/java/org/keycloak/plugin/rhmi/DelayAuthentication.java index c95157c..7b5b169 100644 --- a/src/main/java/org/keycloak/plugin/rhmi/DelayAuthentication.java +++ b/src/main/java/org/keycloak/plugin/rhmi/DelayAuthentication.java @@ -47,14 +47,14 @@ private boolean isUserCreated(UserModel user) { return false; } - String userCreatedAtt = user.getFirstAttribute(DelayAuthentication.USER_CREATED_ATTRIBUTE); - if (userCreatedAtt == null) { + List listOfAttributeValue = user.getAttribute(DelayAuthentication.USER_CREATED_ATTRIBUTE); + if (listOfAttributeValue.isEmpty()) { logger.debugf("User is created but %s attribute in keycloak is null", DelayAuthentication.USER_CREATED_ATTRIBUTE); return false; } - if (!userCreatedAtt.equals(DelayAuthentication.USER_CREATED_VALUE)) { - logger.debugf("%s attribute value in keycloak is not equals to %s", + if (!listOfAttributeValue.contains(DelayAuthentication.USER_CREATED_VALUE)) { + logger.debugf("%s attribute value in keycloak does not contain %s", DelayAuthentication.USER_CREATED_ATTRIBUTE, DelayAuthentication.USER_CREATED_VALUE );