cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor update to the oauth2 provider
Date Tue, 19 Jan 2016 11:53:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 9f0d1b323 -> 4d0c6df1e


Minor update to the oauth2 provider


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4d0c6df1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4d0c6df1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4d0c6df1

Branch: refs/heads/3.1.x-fixes
Commit: 4d0c6df1e561f5e6d118430349a09360c9dd754f
Parents: 9f0d1b3
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Jan 19 11:52:34 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Jan 19 11:53:28 2016 +0000

----------------------------------------------------------------------
 .../security/oauth2/provider/AbstractOAuthDataProvider.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4d0c6df1/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
index e836898..ec607b3 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/AbstractOAuthDataProvider.java
@@ -159,13 +159,12 @@ 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");
+        }
         if (requestedScopes.isEmpty()) {
             return Collections.emptyList();
         } else if (!permissionMap.isEmpty()) {
-            if (requiredScopes != null && !requestedScopes.containsAll(requiredScopes))
{
-                throw new OAuthServiceException("Required scopes are missing");
-            }
-            
             List<OAuthPermission> list = new ArrayList<OAuthPermission>();
             for (String scope : requestedScopes) {
                 OAuthPermission permission = permissionMap.get(scope);


Mime
View raw message