diff --git a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/validators/JDBCScopeValidator.java b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/validators/JDBCScopeValidator.java index 285c24d8acd..700b1f3e266 100644 --- a/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/validators/JDBCScopeValidator.java +++ b/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/validators/JDBCScopeValidator.java @@ -86,6 +86,7 @@ public class JDBCScopeValidator extends OAuth2ScopeValidator { private static final String SCOPE_VALIDATOR_NAME = "Role based scope validator"; private static final String OPENID = "openid"; private static final String ATTRIBUTE_SEPARATOR = FrameworkUtils.getMultiAttributeSeparator(); + private static final String PRESERVE_CASE_SENSITIVITY = "preservedCaseSensitive"; private static final Log log = LogFactory.getLog(JDBCScopeValidator.class); @@ -396,11 +397,11 @@ private boolean isUserAuthorizedForScope(String scopeName, String[] userRoles, i } return false; } - boolean preservedCaseSensitive = Boolean.parseBoolean(System.getProperty("preservedCaseSensitive")); + boolean preservedCaseSensitive = Boolean.parseBoolean(System.getProperty(PRESERVE_CASE_SENSITIVITY)); //Check if the user still has a valid role for this scope. Set scopeRoles = new HashSet<>(rolesOfScope); - if (!preservedCaseSensitive) { + if (preservedCaseSensitive) { rolesOfScope.retainAll(Arrays.asList(userRoles)); } else { for (String roleOfScope : rolesOfScope) {