cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject [3/3] cxf-fediz git commit: [Fediz-101] Fixing TargetScope MetadataDocument generation
Date Thu, 23 Apr 2015 15:36:23 GMT
[Fediz-101] Fixing TargetScope MetadataDocument generation


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/6415da23
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/6415da23
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/6415da23

Branch: refs/heads/master
Commit: 6415da23fc444cc06e25757efc5c4b2a17ba9faa
Parents: 7d7e1c6
Author: Jan Bernhardt <jbernhardt@talend.com>
Authored: Thu Apr 23 17:24:28 2015 +0200
Committer: Jan Bernhardt <jbernhardt@talend.com>
Committed: Thu Apr 23 17:36:00 2015 +0200

----------------------------------------------------------------------
 .../cxf/fediz/core/metadata/MetadataWriter.java | 30 +++++++-------------
 1 file changed, 10 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6415da23/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
index 2daaa13..d55cdcf 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
@@ -29,7 +29,6 @@ import java.net.URL;
 import java.security.cert.X509Certificate;
 import java.util.List;
 
-import javax.security.auth.callback.CallbackHandler;
 import javax.servlet.http.HttpServletRequest;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.XMLOutputFactory;
@@ -171,29 +170,20 @@ public class MetadataWriter {
 
         // create target scope element
         writer.writeStartElement("fed", "TargetScope", WS_FEDERATION_NS);
-        writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
-        writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
-
-        FederationProtocol protocol = (FederationProtocol)config.getProtocol();
-        
-        Object realmObj = protocol.getRealm();
-        String realm = null;
-        if (realmObj instanceof String) {
-            realm = (String)realmObj;
-        } else if (realmObj instanceof CallbackHandler) {
-            //TODO
-            //If realm is resolved at runtime, metadata not updated
-        }
 
-        if (!(realm == null || "".equals(realm))) {
-            writer.writeCharacters(realm);
+        List<String> audienceUris = config.getAudienceUris();
+        if (audienceUris != null) {
+            for (String uri : audienceUris) {
+                writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
+                writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
+                writer.writeCharacters(uri);
+                writer.writeEndElement(); // Address
+                writer.writeEndElement(); // EndpointReference
+            }
         }
-        
-        // writer.writeCharacters("http://host:port/url from config");
-        writer.writeEndElement(); // Address
-        writer.writeEndElement(); // EndpointReference
         writer.writeEndElement(); // TargetScope
 
+        FederationProtocol protocol = (FederationProtocol)config.getProtocol();
         List<Claim> claims = protocol.getClaimTypesRequested();
         if (claims != null && claims.size() > 0) {
 


Mime
View raw message