Skip to content

Commit

Permalink
Merge pull request #1829 from msm1992/master-12584
Browse files Browse the repository at this point in the history
Rectify use of preservedCaseSensitive system property
  • Loading branch information
somindatommy authored Apr 19, 2022
2 parents 8e7d1df + f6b75ad commit 502a178
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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<String> scopeRoles = new HashSet<>(rolesOfScope);
if (!preservedCaseSensitive) {
if (preservedCaseSensitive) {
rolesOfScope.retainAll(Arrays.asList(userRoles));
} else {
for (String roleOfScope : rolesOfScope) {
Expand Down

0 comments on commit 502a178

Please sign in to comment.