Skip to content

Commit

Permalink
Merge pull request #2 from jjaferson/master
Browse files Browse the repository at this point in the history
Fixes check for keycloakuser attribute
  • Loading branch information
matskiv authored Apr 28, 2020
2 parents 84a9cff + 27cd3bd commit 84296ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ hs_err_pid*
/target/*
/plugin/*
.settings/*
.project
.project
/target/
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ private boolean isUserCreated(UserModel user) {
return false;
}

String userCreatedAtt = user.getFirstAttribute(DelayAuthentication.USER_CREATED_ATTRIBUTE);
if (userCreatedAtt == null) {
List<String> 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
);
Expand Down

0 comments on commit 84296ea

Please sign in to comment.