cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1391146 - in /cxf/fediz/trunk/services/sts/src/main: java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java webapp/WEB-INF/cxf-transport.xml webapp/WEB-INF/userClaims.xml
Date Thu, 27 Sep 2012 17:56:48 GMT
Author: owulff
Date: Thu Sep 27 17:56:47 2012
New Revision: 1391146

URL: http://svn.apache.org/viewvc?rev=1391146&view=rev
Log:
[FEDIZ-18] Make supported claims configurable in FileClaimsHandler

Modified:
    cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
    cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
    cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/userClaims.xml

Modified: cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java?rev=1391146&r1=1391145&r2=1391146&view=diff
==============================================================================
--- cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
(original)
+++ cxf/fediz/trunk/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
Thu Sep 27 17:56:47 2012
@@ -19,13 +19,12 @@
 package org.apache.cxf.fediz.service.sts;
 
 import java.net.URI;
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.cxf.sts.claims.Claim;
 import org.apache.cxf.sts.claims.ClaimCollection;
-import org.apache.cxf.sts.claims.ClaimTypes;
 import org.apache.cxf.sts.claims.ClaimsHandler;
 import org.apache.cxf.sts.claims.ClaimsParameters;
 import org.apache.cxf.sts.claims.RequestClaim;
@@ -40,6 +39,7 @@ public class FileClaimsHandler implement
         URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
 
     private Map<String, Map<String, String>> userClaims;
+    private List<URI> supportedClaims;
 
     public void setUserClaims(Map<String, Map<String, String>> userClaims) {
         this.userClaims = userClaims;
@@ -48,16 +48,16 @@ public class FileClaimsHandler implement
     public Map<String, Map<String, String>> getUserClaims() {
         return userClaims;
     }
-
+    
+    public void setSupportedClaims(List<URI> supportedClaims) {
+        this.supportedClaims = supportedClaims;
+    }
+    
     @Override
     public List<URI> getSupportedClaimTypes() {
-        List<URI> list = new ArrayList<URI>();
-        list.add(ClaimTypes.EMAILADDRESS);
-        list.add(ClaimTypes.LASTNAME);
-        list.add(ClaimTypes.FIRSTNAME);
-        list.add(ROLE);
-        return list;
+        return Collections.unmodifiableList(this.supportedClaims);
     }
+    
 
     @Override
     public ClaimCollection retrieveClaimValues(RequestClaimCollection claims,

Modified: cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml?rev=1391146&r1=1391145&r2=1391146&view=diff
==============================================================================
--- cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml (original)
+++ cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/cxf-transport.xml Thu Sep 27 17:56:47
2012
@@ -91,6 +91,7 @@
 	<bean id="fileClaimsHandler" class="org.apache.cxf.fediz.service.sts.FileClaimsHandler">
 
 		<property name="userClaims" ref="userClaims" />
+		<property name="supportedClaims" ref="supportedClaims" />
 	</bean>
 
 	<import resource="passwords.xml" />

Modified: cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/userClaims.xml
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/userClaims.xml?rev=1391146&r1=1391145&r2=1391146&view=diff
==============================================================================
--- cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/userClaims.xml (original)
+++ cxf/fediz/trunk/services/sts/src/main/webapp/WEB-INF/userClaims.xml Thu Sep 27 17:56:47
2012
@@ -49,5 +49,12 @@
 		<entry key="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role"
 			value="" />			
 	</util:map>
+	
+	<util:list id="supportedClaims">
+		<value>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname</value>
+		<value>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname</value>
+		<value>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress</value>
+		<value>http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role</value>
+	</util:list>
 
 </beans>
\ No newline at end of file



Mime
View raw message