You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2015/12/04 18:11:13 UTC

[1/5] cxf git commit: Make sure the default scopes are returned to the user

Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 48ecb0fce -> 85a45a8bc


Make sure the default scopes are returned to the user


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

Branch: refs/heads/3.1.x-fixes
Commit: 4efd6b4c188c7e7c94feb6afc943df831da43180
Parents: 48ecb0f
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 4 16:13:13 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 4 17:04:06 2015 +0000

----------------------------------------------------------------------
 .../oauth2/services/AuthorizationCodeGrantService.java |  6 ++++--
 .../security/oauth2/services/ImplicitGrantService.java |  4 +++-
 .../oauth2/services/RedirectionBasedGrantService.java  | 13 ++++++++++---
 3 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4efd6b4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
index b95eae7..36615e7 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationCodeGrantService.java
@@ -68,10 +68,12 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
                                                              MultivaluedMap<String, String> params,
                                                              String redirectUri,
                                                              UserSubject subject,
+                                                             List<String> requestedScopes,
                                                              List<OAuthPermission> perms,
                                                              boolean authorizationCanBeSkipped) {
         OAuthAuthorizationData data = 
-            super.createAuthorizationData(client, params, redirectUri, subject, perms, authorizationCanBeSkipped);
+            super.createAuthorizationData(client, params, redirectUri, subject, 
+                                          requestedScopes, perms, authorizationCanBeSkipped);
         setCodeQualifier(data, params);
         return data;
     }
@@ -105,7 +107,7 @@ public class AuthorizationCodeGrantService extends RedirectionBasedGrantService
         codeReg.setClient(client);
         codeReg.setRedirectUri(state.getRedirectUri());
         codeReg.setRequestedScope(requestedScope);
-        if (approvedScope != null && approvedScope.isEmpty()) {
+        if (approvedScope == null || approvedScope.isEmpty()) {
             // no down-scoping done by a user, all of the requested scopes have been authorized
             codeReg.setApprovedScope(requestedScope);
         } else {

http://git-wip-us.apache.org/repos/asf/cxf/blob/4efd6b4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java
index 057c59d..bec3714 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/ImplicitGrantService.java
@@ -55,10 +55,12 @@ public class ImplicitGrantService extends AbstractImplicitGrantService {
                                                              MultivaluedMap<String, String> params,
                                                              String redirectUri,
                                                              UserSubject subject,
+                                                             List<String> requestedScopes,
                                                              List<OAuthPermission> perms,
                                                              boolean authorizationCanBeSkipped) {
         OAuthAuthorizationData data = 
-            super.createAuthorizationData(client, params, redirectUri, subject, perms, authorizationCanBeSkipped);
+            super.createAuthorizationData(client, params, redirectUri, subject, 
+                                          requestedScopes, perms, authorizationCanBeSkipped);
         data.setImplicitFlow(true);
         return data;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4efd6b4c/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
index cc9baba..53cedaf 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
@@ -172,8 +172,8 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
         
         // Populate the authorization challenge data 
         OAuthAuthorizationData data = 
-            createAuthorizationData(client, params, redirectUri, userSubject, requestedPermissions, 
-                                    authorizationCanBeSkipped);
+            createAuthorizationData(client, params, redirectUri, userSubject, requestedScope, 
+                                    requestedPermissions, authorizationCanBeSkipped);
         
         if (authorizationCanBeSkipped) {
             List<OAuthPermission> approvedScopes = 
@@ -203,6 +203,7 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
                                                              MultivaluedMap<String, String> params,
                                                              String redirectUri, 
                                                              UserSubject subject,
+                                                             List<String> requestedScope,
                                                              List<OAuthPermission> perms,
                                                              boolean authorizationCanBeSkipped) {
         
@@ -213,7 +214,13 @@ public abstract class RedirectionBasedGrantService extends AbstractOAuthService
         secData.setAudience(params.getFirst(OAuthConstants.CLIENT_AUDIENCE));
         secData.setNonce(params.getFirst(OAuthConstants.NONCE));
         secData.setClientId(client.getClientId());
-        secData.setProposedScope(params.getFirst(OAuthConstants.SCOPE));
+        if (requestedScope != null && !requestedScope.isEmpty()) {
+            StringBuilder builder = new StringBuilder();
+            for (String scope : requestedScope) {
+                builder.append(scope + " ");
+            }
+            secData.setProposedScope(builder.toString().trim());
+        }
         if (!authorizationCanBeSkipped) {
             secData.setPermissions(perms);
             secData.setApplicationName(client.getApplicationName()); 


[5/5] cxf git commit: Fixing backmerge

Posted by co...@apache.org.
Fixing backmerge


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

Branch: refs/heads/3.1.x-fixes
Commit: 85a45a8bc4da81aee75438cc0c59c8a1efda91cb
Parents: 770ea4c
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 4 17:11:01 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 4 17:11:01 2015 +0000

----------------------------------------------------------------------
 .../security/oauth2/common/OAuthPermission.java | 97 +-------------------
 .../rs/security/oauth2/common/Permission.java   | 39 ++++++++
 2 files changed, 43 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/85a45a8b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
index 88a2ad6..0421581 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
@@ -77,75 +77,9 @@ public class OAuthPermission extends Permission {
         return uris;
     }
     
-<<<<<<< HEAD
-=======
-    /**
-     * Gets the permission description
-     * @return the description
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Sets the permission description
-     * @param description
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Get the permission value such as "read_calendar"
-     * @return the value
-     */
-    public String getPermission() {
-        return permission;
-    }
-
-    /**
-     * Sets the permission value such as "read_calendar"
-     * @param permission the permission value
-     */
-    public void setPermission(String permission) {
-        this.permission = permission;
-    }
-
-    /**
-     * Indicates if this permission has been allocated by default or not.
-     * Authorization View handlers may use this property to optimize the way the user selects the
-     * scopes.
-     * For example, assume that read', 'add' and 'update' scopes are supported and the 
-     * 'read' scope is always allocated. This can be presented at the UI level as follows:
-     * the read-only check-box control will represent a 'read' scope and a user will be able to
-     * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. 
-     * @param isDefault true if the permission has been allocated by default
-     */
-    public void setDefault(boolean value) {
-        this.isDefault = value;
-    }
-
-    public boolean isDefault() {
-        return isDefault;
-    }
-
-    public boolean isInvisibleToClient() {
-        return invisibleToClient;
-    }
-
-    /**
-     * Set the visibility status; by default all the scopes approved by a user can 
-     * be optionally reported to the client in access token responses. Some scopes may need
-     * to stay 'invisible' to client.
-     * @param invisibleToClient
-     */
-    public void setInvisibleToClient(boolean invisibleToClient) {
-        this.invisibleToClient = invisibleToClient;
-    }
-    
     @Override
     public boolean equals(Object object) {
-        if (!(object instanceof OAuthPermission)) {
+        if (!(object instanceof OAuthPermission) || !super.equals(object)) {
             return false;
         }
         
@@ -155,22 +89,8 @@ public class OAuthPermission extends Permission {
             || this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) {
             return false;
         }
-        if (this.uris != null && that.uris == null
-            || this.uris == null && that.uris != null
-            || this.uris != null && !this.uris.equals(that.uris)) {
-            return false;
-        }
-        if (this.permission != null && that.permission == null
-            || this.permission == null && that.permission != null
-            || this.permission != null && !this.permission.equals(that.permission)) {
-            return false;
-        }
-        if (this.description != null && that.description == null
-            || this.description == null && that.description != null
-            || this.description != null && !this.description.equals(that.description)) {
-            return false;
-        }
-        if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD
+        if (this.uris != null && that.uris == null || this.uris == null && that.uris != null //NOPMD
+            || this.uris != null && !this.uris.equals(that.uris)) { //NOPMD
             return false;
         }
         
@@ -179,23 +99,14 @@ public class OAuthPermission extends Permission {
     
     @Override
     public int hashCode() {
-        int hashCode = 17;
+        int hashCode = super.hashCode();
         if (httpVerbs != null) {
             hashCode = 31 * hashCode + httpVerbs.hashCode();
         }
         if (uris != null) {
             hashCode = 31 * hashCode + uris.hashCode();
         }
-        if (permission != null) {
-            hashCode = 31 * hashCode + permission.hashCode();
-        }
-        if (description != null) {
-            hashCode = 31 * hashCode + description.hashCode();
-        }
-        hashCode = 31 * hashCode + Boolean.hashCode(invisibleToClient);
-        hashCode = 31 * hashCode + Boolean.hashCode(isDefault);
         
         return hashCode;
     }
->>>>>>> 8583a24... Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/85a45a8b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Permission.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Permission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Permission.java
index f6d4d29..6d293e5 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Permission.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/Permission.java
@@ -103,4 +103,43 @@ public class Permission implements Serializable {
     public void setInvisibleToClient(boolean invisibleToClient) {
         this.invisibleToClient = invisibleToClient;
     }
+    
+    @Override
+    public boolean equals(Object object) {
+        if (!(object instanceof Permission)) {
+            return false;
+        }
+        
+        Permission that = (Permission)object;
+        if (this.permission != null && that.permission == null
+            || this.permission == null && that.permission != null
+            || this.permission != null && !this.permission.equals(that.permission)) {
+            return false;
+        }
+        if (this.description != null && that.description == null
+            || this.description == null && that.description != null
+            || this.description != null && !this.description.equals(that.description)) {
+            return false;
+        }
+        if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD
+            return false;
+        }
+        
+        return true;
+    }
+    
+    @Override
+    public int hashCode() {
+        int hashCode = 17;
+        if (permission != null) {
+            hashCode = 31 * hashCode + permission.hashCode();
+        }
+        if (description != null) {
+            hashCode = 31 * hashCode + description.hashCode();
+        }
+        hashCode = 31 * hashCode + Boolean.hashCode(invisibleToClient);
+        hashCode = 31 * hashCode + Boolean.hashCode(isDefault);
+        
+        return hashCode;
+    }
 }


[4/5] cxf git commit: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
Recording .gitmergeinfo Changes


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

Branch: refs/heads/3.1.x-fixes
Commit: 770ea4c9b218ba34526fce5903feae6959c3366c
Parents: 5c05f1c
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 4 17:04:12 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 4 17:04:12 2015 +0000

----------------------------------------------------------------------
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/770ea4c9/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 28a0a76..83dc437 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -12,3 +12,4 @@ B f0e08b7bea2660542e18294d490e68c7b14aaa4b
 B f1b56150d6520e73d2ade2296c3b2f13839e63e5
 B f94e1dd9b2a8d27ec5a27bfb7c026e3ae2350e39
 B fb30f8bffc85fcc3208fcc0e1eda4b54a89b5d37
+M 8583a24ac541dc373503d7a6c59cd90890acdae3


[2/5] cxf git commit: Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works

Posted by co...@apache.org.
Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works

Conflicts:
	rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java


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

Branch: refs/heads/3.1.x-fixes
Commit: b7d33366f3311dc33c7da389f98fced6fd470c93
Parents: 4efd6b4
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 4 16:34:03 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 4 17:04:10 2015 +0000

----------------------------------------------------------------------
 .../security/oauth2/common/OAuthPermission.java | 124 +++++++++++++++++++
 .../services/AbstractImplicitGrantService.java  |   2 +-
 2 files changed, 125 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b7d33366/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
index 0aaf300..f23e2ad 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
@@ -77,4 +77,128 @@ public class OAuthPermission extends Permission {
         return uris;
     }
     
+<<<<<<< HEAD
+=======
+    /**
+     * Gets the permission description
+     * @return the description
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the permission description
+     * @param description
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * Get the permission value such as "read_calendar"
+     * @return the value
+     */
+    public String getPermission() {
+        return permission;
+    }
+
+    /**
+     * Sets the permission value such as "read_calendar"
+     * @param permission the permission value
+     */
+    public void setPermission(String permission) {
+        this.permission = permission;
+    }
+
+    /**
+     * Indicates if this permission has been allocated by default or not.
+     * Authorization View handlers may use this property to optimize the way the user selects the
+     * scopes.
+     * For example, assume that read', 'add' and 'update' scopes are supported and the 
+     * 'read' scope is always allocated. This can be presented at the UI level as follows:
+     * the read-only check-box control will represent a 'read' scope and a user will be able to
+     * optionally select 'add' and/or 'update' scopes, in addition to the default 'read' one. 
+     * @param isDefault true if the permission has been allocated by default
+     */
+    public void setDefault(boolean value) {
+        this.isDefault = value;
+    }
+
+    public boolean isDefault() {
+        return isDefault;
+    }
+
+    public boolean isInvisibleToClient() {
+        return invisibleToClient;
+    }
+
+    /**
+     * Set the visibility status; by default all the scopes approved by a user can 
+     * be optionally reported to the client in access token responses. Some scopes may need
+     * to stay 'invisible' to client.
+     * @param invisibleToClient
+     */
+    public void setInvisibleToClient(boolean invisibleToClient) {
+        this.invisibleToClient = invisibleToClient;
+    }
+    
+    @Override
+    public boolean equals(Object object) {
+        if (!(object instanceof OAuthPermission)) {
+            return false;
+        }
+        
+        OAuthPermission that = (OAuthPermission)object;
+        if (this.httpVerbs != null && that.httpVerbs == null
+            || this.httpVerbs == null && that.httpVerbs != null
+            || this.httpVerbs != null && !this.httpVerbs.equals(that.httpVerbs)) {
+            return false;
+        }
+        if (this.uris != null && that.uris == null
+            || this.uris == null && that.uris != null
+            || this.uris != null && !this.uris.equals(that.uris)) {
+            return false;
+        }
+        if (this.permission != null && that.permission == null
+            || this.permission == null && that.permission != null
+            || this.permission != null && !this.permission.equals(that.permission)) {
+            return false;
+        }
+        if (this.description != null && that.description == null
+            || this.description == null && that.description != null
+            || this.description != null && !this.description.equals(that.description)) {
+            return false;
+        }
+        if (this.invisibleToClient != that.invisibleToClient) {
+            return false;
+        }
+        if (this.isDefault != that.isDefault) {
+            return false;
+        }
+        
+        return true;
+    }
+    
+    @Override
+    public int hashCode() {
+        int hashCode = 17;
+        if (httpVerbs != null) {
+            hashCode = 31 * hashCode + httpVerbs.hashCode();
+        }
+        if (uris != null) {
+            hashCode = 31 * hashCode + uris.hashCode();
+        }
+        if (permission != null) {
+            hashCode = 31 * hashCode + permission.hashCode();
+        }
+        if (description != null) {
+            hashCode = 31 * hashCode + description.hashCode();
+        }
+        hashCode = 31 * hashCode + Boolean.hashCode(invisibleToClient);
+        hashCode = 31 * hashCode + Boolean.hashCode(isDefault);
+        
+        return hashCode;
+    }
+>>>>>>> 8583a24... Add equals/hashCode methods for OAuthPermission so that the containsAll call in AbstractOAuthDataProvider.doRefreshAccessToken works
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/b7d33366/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
index 139c05b..cee77da 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractImplicitGrantService.java
@@ -71,7 +71,7 @@ public abstract class AbstractImplicitGrantService extends RedirectionBasedGrant
                 reg.setGrantType(super.getSupportedGrantType());
                 reg.setSubject(userSubject);
                 reg.setRequestedScope(requestedScope);        
-                if (approvedScope != null && approvedScope.isEmpty()) {
+                if (approvedScope == null || approvedScope.isEmpty()) {
                     // no down-scoping done by a user, all of the requested scopes have been authorized
                     reg.setApprovedScope(requestedScope);
                 } else {


[3/5] cxf git commit: PMD fix

Posted by co...@apache.org.
PMD fix


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

Branch: refs/heads/3.1.x-fixes
Commit: 5c05f1c06e9b2d71eb2e85128ef4e2d9978ec17f
Parents: b7d3336
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Dec 4 16:38:21 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Dec 4 17:04:12 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/rs/security/oauth2/common/OAuthPermission.java   | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5c05f1c0/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
index f23e2ad..88a2ad6 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/OAuthPermission.java
@@ -170,10 +170,7 @@ public class OAuthPermission extends Permission {
             || this.description != null && !this.description.equals(that.description)) {
             return false;
         }
-        if (this.invisibleToClient != that.invisibleToClient) {
-            return false;
-        }
-        if (this.isDefault != that.isDefault) {
+        if (this.invisibleToClient != that.invisibleToClient || this.isDefault != that.isDefault) { //NOPMD
             return false;
         }