Author: coheigea
Date: Thu May 17 11:17:16 2012
New Revision: 1339552

URL: http://svn.apache.org/viewvc?rev=1339552&view=rev
Log:
[CXF-4320] - Add the ClaimsAttributeStatementProvider by default to the 
SAMLTokenProvider

Modified:
    
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
    
cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml

Modified: 
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
URL: 
http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java?rev=1339552&r1=1339551&r2=1339552&view=diff
==============================================================================
--- 
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
 (original)
+++ 
cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
 Thu May 17 11:17:16 2012
@@ -39,6 +39,7 @@ import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.sts.STSConstants;
 import org.apache.cxf.sts.STSPropertiesMBean;
 import org.apache.cxf.sts.SignatureProperties;
+import org.apache.cxf.sts.claims.ClaimsAttributeStatementProvider;
 import org.apache.cxf.sts.request.KeyRequirements;
 import org.apache.cxf.sts.request.Renewing;
 import org.apache.cxf.sts.request.TokenRequirements;
@@ -457,7 +458,8 @@ public class SAMLTokenProvider implement
             }
         }
         
-        // If no statements, then default to the 
DefaultAttributeStatementProvider
+        // If no statements, then default to the 
DefaultAttributeStatementProvider and the
+        // ClaimsAttributeStatementProvider
         if ((attrBeanList == null || attrBeanList.isEmpty()) 
             && (authBeanList == null || authBeanList.isEmpty())
             && (authDecisionBeanList == null || 
authDecisionBeanList.isEmpty())) {
@@ -465,6 +467,12 @@ public class SAMLTokenProvider implement
             AttributeStatementProvider attributeProvider = new 
DefaultAttributeStatementProvider();
             AttributeStatementBean attributeBean = 
attributeProvider.getStatement(tokenParameters);
             attrBeanList.add(attributeBean);
+            
+            attributeProvider = new ClaimsAttributeStatementProvider();
+            attributeBean = attributeProvider.getStatement(tokenParameters);
+            if (attributeBean != null) {
+                attrBeanList.add(attributeBean);
+            }
         }
         
         // Get the Subject and Conditions

Modified: 
cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml?rev=1339552&r1=1339551&r2=1339552&view=diff
==============================================================================
--- 
cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml
 (original)
+++ 
cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-sts.xml
 Thu May 17 11:17:16 2012
@@ -89,9 +89,9 @@
        </bean>
 
        <bean id="transportSamlTokenProvider" 
class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
-               <property name="attributeStatementProviders" 
ref="attributeStatementProvidersList" />
+               <!-- <property name="attributeStatementProviders" 
ref="attributeStatementProvidersList" />-->
        </bean>
-
+<!-- 
        <util:list id="attributeStatementProvidersList">
                <ref bean="defaultAttributeProvider" />
                <ref bean="customAttributeProvider" />
@@ -104,7 +104,7 @@
        <bean id="customAttributeProvider"
                
class="org.apache.cxf.systest.sts.deployment.CustomAttributeStatementProvider">
        </bean>
-
+-->
        <bean id="claimsManager" 
class="org.apache.cxf.sts.claims.ClaimsManager">
                <property name="claimHandlers" ref="claimHandlerList" />
        </bean>


Reply via email to