Skip to content

Commit

Permalink
Rectify use of preservedCaseSensitive system property
Browse files Browse the repository at this point in the history
  • Loading branch information
msm1992 committed Apr 12, 2022
1 parent 7b8dd12 commit f6b75ad
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 f6b75ad

Please sign in to comment.