coheigea commented on code in PR #3297:
URL: https://github.com/apache/cxf/pull/3297#discussion_r3557898355
##########
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:
RFC 6749, Section 3.3 says the scope parameter is a space-delimited list of
case-sensitive strings defined by the authorization server. So I think we are
OK to require case sensitivity.
--
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]