reta commented on code in PR #3297:
URL: https://github.com/apache/cxf/pull/3297#discussion_r3552772851
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/DynamicRegistrationService.java:
##########
@@ -417,6 +423,28 @@ public void setUserRole(String userRole) {
this.userRole = userRole;
}
+ public void setAllowedClientScopes(List<String> allowedClientScopes) {
+ this.allowedClientScopes = allowedClientScopes;
+ }
+
+ protected void validateClientScopes(List<String> requestedScopes) {
+ if (requestedScopes == null || requestedScopes.isEmpty()) {
+ return;
+ }
+
+ List<String> allowedScopes = allowedClientScopes;
+ if (allowedScopes == null && clientProvider instanceof
AbstractOAuthDataProvider) {
+ allowedScopes = new java.util.ArrayList<>(
+
((AbstractOAuthDataProvider)clientProvider).getPermissionMap().keySet());
+ }
+
+ if (allowedScopes != null && !new
HashSet<>(allowedScopes).containsAll(requestedScopes)) {
Review Comment:
Do we care about string case sensitivity? (lower case <-> upper case fe)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]