cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1408264 - /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
Date Mon, 12 Nov 2012 12:41:38 GMT
Author: coheigea
Date: Mon Nov 12 12:41:37 2012
New Revision: 1408264

URL: http://svn.apache.org/viewvc?rev=1408264&view=rev
Log:
[CXF-4628] - Only use default AttributeStatementProvider in STS if no Claims were handled

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java

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=1408264&r1=1408263&r2=1408264&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
Mon Nov 12 12:41:37 2012
@@ -458,20 +458,20 @@ public class SAMLTokenProvider implement
             }
         }
         
-        // If no providers have been configured, then default to the 
-        // DefaultAttributeStatementProvider and the ClaimsAttributeStatementProvider
+        // If no providers have been configured, then default to the ClaimsAttributeStatementProvider
+        // If no Claims are available then use the DefaultAttributeStatementProvider
         if ((attributeStatementProviders == null || attributeStatementProviders.isEmpty())

             && (authenticationStatementProviders == null || authenticationStatementProviders.isEmpty())
             && (authDecisionStatementProviders == null || authDecisionStatementProviders.isEmpty()))
{
             attrBeanList = new ArrayList<AttributeStatementBean>();
-            AttributeStatementProvider attributeProvider = new DefaultAttributeStatementProvider();
+            AttributeStatementProvider attributeProvider = new ClaimsAttributeStatementProvider();
             AttributeStatementBean attributeBean = attributeProvider.getStatement(tokenParameters);
-            attrBeanList.add(attributeBean);
-            
-            attributeProvider = new ClaimsAttributeStatementProvider();
-            attributeBean = attributeProvider.getStatement(tokenParameters);
             if (attributeBean != null) {
                 attrBeanList.add(attributeBean);
+            } else {
+                attributeProvider = new DefaultAttributeStatementProvider();
+                attributeBean = attributeProvider.getStatement(tokenParameters);
+                attrBeanList.add(attributeBean);
             }
         }
         



Mime
View raw message