cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1179659 - /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
Date Thu, 06 Oct 2011 15:16:54 GMT
Author: coheigea
Date: Thu Oct  6 15:16:54 2011
New Revision: 1179659

URL: http://svn.apache.org/viewvc?rev=1179659&view=rev
Log:
Relativise returned claim names against the namespace

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java?rev=1179659&r1=1179658&r2=1179659&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
Thu Oct  6 15:16:54 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.sts.claims;
 
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -55,12 +56,13 @@ public class ClaimsAttributeStatementPro
         while (claimIterator.hasNext()) {
             Claim claim = claimIterator.next();
             AttributeBean attributeBean = new AttributeBean();
+            URI name = claim.getNamespace().relativize(claim.getClaimType());
             if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
                 || WSConstants.SAML2_NS.equals(tokenType)) {
-                attributeBean.setQualifiedName(claim.getClaimType().toString());
+                attributeBean.setQualifiedName(name.toString());
                 attributeBean.setNameFormat(claim.getNamespace().toString());
             } else {
-                attributeBean.setSimpleName(claim.getClaimType().toString());
+                attributeBean.setSimpleName(name.toString());
                 attributeBean.setQualifiedName(claim.getNamespace().toString());
             }
             attributeBean.setAttributeValues(Collections.singletonList(claim.getValue()));



Mime
View raw message