Minor update to the abstract oauth2 provider
@@ -245,9 +245,7 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider, Cl
@Override
public List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScopes) {
- if (requiredScopes != null && !requestedScopes.containsAll(requiredScopes)) {
- throw new OAuthServiceException("Required scopes are missing");
- }
+ checkRequestedScopes(client, requestedScopes);
if (requestedScopes.isEmpty()) {
return Collections.emptyList();
} else {
@@ -263,6 +261,12 @@ public abstract class AbstractOAuthDataProvider implements OAuthDataProvider, Cl
}
+ protected void checkRequestedScopes(Client client, List<String> requestedScopes) {
+ if (requiredScopes != null && !requestedScopes.containsAll(requiredScopes)) {
+ throw new OAuthServiceException("Required scopes are missing");
+ }
+ }
+
protected void convertSingleScopeToPermission(Client client,
String scope,
List<OAuthPermission> perms) {
