Skip to content

Commit

Permalink
java 8 compatible changes
Browse files Browse the repository at this point in the history
  • Loading branch information
instipod committed Feb 2, 2021
1 parent 73ac554 commit 56bd3c1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ public boolean matchCondition(AuthenticationFlowContext context) {
boolean not = AuthenticatorUtils.getConfigBoolean(context, ConditionalAttributeAuthenticatorFactory.CONDITIONAL_NOT);
String attributeName = authConfig.getConfig().get(ConditionalAttributeAuthenticatorFactory.CONDITIONAL_ATTRIBUTE_NAME);
String attributeValue = authConfig.getConfig().get(ConditionalAttributeAuthenticatorFactory.CONDITIONAL_ATTRIBUTE_VALUE);
attributeName = AuthenticatorUtils.variableReplace(context, attributeName);
attributeValue = AuthenticatorUtils.variableReplace(context, attributeValue);
if (attributeName != null)
attributeName = AuthenticatorUtils.variableReplace(context, attributeName);
if (attributeValue != null)
attributeValue = AuthenticatorUtils.variableReplace(context, attributeValue);

List<String> values = context.getUser().getAttribute(attributeName);
boolean hasAttribute;
if (attributeValue.isBlank()) {
if (attributeValue == null || attributeValue == "") {
//check presence only
hasAttribute = (values.size() > 0);
} else {
Expand Down

0 comments on commit 56bd3c1

Please sign in to comment.