Fixing claims issue

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

Branch: refs/heads/master
Commit: 4660cd8ca1a2530aff7848618e0a70190951597e
Parents: ad71b7a
Author: Colm O hEigeartaigh <[email protected]>
Authored: Fri Feb 12 15:25:23 2016 +0000
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Fri Feb 12 15:25:23 2016 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4660cd8c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
----------------------------------------------------------------------
diff --git 
a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
 
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
index b13f54a..631e8fc 100644
--- 
a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
+++ 
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
@@ -220,11 +220,11 @@ public class RESTSecurityTokenServiceImpl extends 
SecurityTokenServiceImpl imple
         }
 
         // Claims
-        if (requestedClaims == null) {
+        if (requestedClaims == null || requestedClaims.isEmpty()) {
             requestedClaims = defaultClaims;
         }
 
-        if (requestedClaims != null) {
+        if (requestedClaims != null && !requestedClaims.isEmpty()) {
             ClaimsType claimsType = of.createClaimsType();
             claimsType.setDialect(CLAIM_TYPE_NS);
             JAXBElement<ClaimsType> claims = of.createClaims(claimsType);
@@ -418,6 +418,7 @@ public class RESTSecurityTokenServiceImpl extends 
SecurityTokenServiceImpl imple
             this.token = token;
         }
         
+        @SuppressWarnings("unused")
         public String getToken() {
             return token;
         }

Reply via email to