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/7c740497 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7c740497 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7c740497 Branch: refs/heads/3.1.x-fixes Commit: 7c7404970a05900911b97c28a08665f5db3dcaa8 Parents: e89e821 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:29:14 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/7c740497/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; }
