cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf-fediz git commit: Some work on supporting metadata for services in the IdP
Date Thu, 28 May 2015 15:42:22 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/1.2.x-fixes e770a5a22 -> ca02971cc


Some work on supporting metadata for services in the IdP


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

Branch: refs/heads/1.2.x-fixes
Commit: e52520d9f6f23ccd068194d8b2609bd1a5095357
Parents: e770a5a
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed May 27 12:28:46 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu May 28 16:42:05 2015 +0100

----------------------------------------------------------------------
 .../cxf/fediz/service/idp/MetadataServlet.java  |  32 ++-
 .../service/idp/metadata/IdpMetadataWriter.java | 197 +++++++++++++++++++
 .../fediz/service/idp/util/MetadataWriter.java  | 197 -------------------
 services/idp/src/main/webapp/WEB-INF/web.xml    |   1 +
 .../service/idp/util/MetadataWriterTest.java    |   3 +-
 5 files changed, 225 insertions(+), 205 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e52520d9/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/MetadataServlet.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/MetadataServlet.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/MetadataServlet.java
index b0fbdb8..a458f56 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/MetadataServlet.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/MetadataServlet.java
@@ -30,8 +30,9 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.w3c.dom.Document;
 import org.apache.cxf.fediz.service.idp.domain.Idp;
+import org.apache.cxf.fediz.service.idp.domain.TrustedIdp;
+import org.apache.cxf.fediz.service.idp.metadata.IdpMetadataWriter;
 import org.apache.cxf.fediz.service.idp.service.ConfigService;
-import org.apache.cxf.fediz.service.idp.util.MetadataWriter;
 import org.apache.wss4j.common.util.DOM2Writer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,13 +57,30 @@ public class MetadataServlet extends HttpServlet {
         IOException {
         response.setContentType("text/xml; charset=utf-8");
         PrintWriter out = response.getWriter();
+        
+        ConfigService cs = (ConfigService)getApplicationContext().getBean("config");
+        Idp idpConfig = cs.getIDP(realm);
         try {
-            ConfigService cs = (ConfigService)getApplicationContext().getBean("config");
-            Idp idpConfig = cs.getIDP(realm);
-            LOG.debug(idpConfig.toString());
-            MetadataWriter mw = new MetadataWriter();
-            Document metadata = mw.getMetaData(idpConfig);
-            out.write(DOM2Writer.nodeToString(metadata));
+            if (request.getServletPath() != null && request.getServletPath().startsWith("/metadata"))
{
+                String serviceRealm = 
+                    request.getRequestURI().substring(request.getRequestURI().indexOf("/metadata")
+                                                      + "/metadata".length());
+                if (serviceRealm != null && serviceRealm.charAt(0) == '/') {
+                    serviceRealm = serviceRealm.substring(1);
+                }
+                TrustedIdp trustedIdp = idpConfig.findTrustedIdp(serviceRealm);
+                if (trustedIdp == null) {
+                    LOG.error("No TrustedIdp found for desired realm: " + serviceRealm);
+                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                }
+                // TODO
+            } else {
+                // Otherwise return the Metadata for the Idp
+                LOG.debug(idpConfig.toString());
+                IdpMetadataWriter mw = new IdpMetadataWriter();
+                Document metadata = mw.getMetaData(idpConfig);
+                out.write(DOM2Writer.nodeToString(metadata));
+            }
         } catch (Exception ex) {
             LOG.error("Failed to get metadata document: ", ex);
             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e52520d9/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
new file mode 100644
index 0000000..cb2f779
--- /dev/null
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
@@ -0,0 +1,197 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.fediz.service.idp.metadata;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.security.cert.X509Certificate;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Document;
+import org.apache.cxf.fediz.core.util.CertsUtils;
+import org.apache.cxf.fediz.core.util.SignatureUtils;
+import org.apache.cxf.fediz.service.idp.domain.Claim;
+import org.apache.cxf.fediz.service.idp.domain.Idp;
+import org.apache.wss4j.common.crypto.Crypto;
+import org.apache.xml.security.stax.impl.util.IDGenerator;
+import org.apache.xml.security.utils.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.cxf.fediz.core.FedizConstants.SAML2_METADATA_NS;
+import static org.apache.cxf.fediz.core.FedizConstants.SCHEMA_INSTANCE_NS;
+import static org.apache.cxf.fediz.core.FedizConstants.WS_ADDRESSING_NS;
+import static org.apache.cxf.fediz.core.FedizConstants.WS_FEDERATION_NS;
+
+public class IdpMetadataWriter {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(IdpMetadataWriter.class);
+    
+    private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
+    private static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
+    
+    static {
+        DOC_BUILDER_FACTORY.setNamespaceAware(true);
+    }
+
+    //CHECKSTYLE:OFF
+    public Document getMetaData(Idp config) throws RuntimeException {
+        //Return as text/xml
+        try {
+            Crypto crypto = CertsUtils.createCrypto(config.getCertificate());
+            
+            ByteArrayOutputStream bout = new ByteArrayOutputStream(4096);
+            Writer streamWriter = new OutputStreamWriter(bout, "UTF-8");
+            XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(streamWriter);
+
+            writer.writeStartDocument("UTF-8", "1.0");
+
+            String referenceID = IDGenerator.generateID("_");
+            writer.writeStartElement("md", "EntityDescriptor", SAML2_METADATA_NS);
+            writer.writeAttribute("ID", referenceID);
+                      
+            writer.writeAttribute("entityID", config.getIdpUrl().toString());
+
+            writer.writeNamespace("md", SAML2_METADATA_NS);
+            writer.writeNamespace("fed", WS_FEDERATION_NS);
+            writer.writeNamespace("wsa", WS_ADDRESSING_NS);
+            writer.writeNamespace("auth", WS_FEDERATION_NS);
+            writer.writeNamespace("xsi", SCHEMA_INSTANCE_NS);
+            
+            writeFederationMetadata(writer, config, crypto);
+            
+            writer.writeEndElement(); // EntityDescriptor
+
+            writer.writeEndDocument();
+            streamWriter.flush();
+            bout.flush();
+
+            if (LOG.isDebugEnabled()) {
+                String out = new String(bout.toByteArray());
+                LOG.debug("***************** unsigned ****************");
+                LOG.debug(out);
+                LOG.debug("***************** unsigned ****************");
+            }
+            
+            InputStream is = new ByteArrayInputStream(bout.toByteArray());
+            
+            Document result = SignatureUtils.signMetaInfo(crypto, null, config.getCertificatePassword(),
is, referenceID);
+            if (result != null) {
+                return result;
+            } else {
+                throw new RuntimeException("Failed to sign the metadata document: result=null");
+            }
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            LOG.error("Error creating service metadata information ", e);
+            throw new RuntimeException("Error creating service metadata information: " +
e.getMessage());
+        }
+        
+    }
+    
+    private void writeFederationMetadata(
+        XMLStreamWriter writer, Idp config, Crypto crypto
+    ) throws XMLStreamException {
+
+        writer.writeStartElement("md", "RoleDescriptor", WS_FEDERATION_NS);
+        writer.writeAttribute(SCHEMA_INSTANCE_NS, "type", "fed:SecurityTokenServiceType");
+        writer.writeAttribute("protocolSupportEnumeration", WS_FEDERATION_NS);
+        if (config.getServiceDescription() != null && config.getServiceDescription().length()
> 0 ) {
+            writer.writeAttribute("ServiceDescription", config.getServiceDescription());
+        }
+        if (config.getServiceDisplayName() != null && config.getServiceDisplayName().length()
> 0 ) {
+            writer.writeAttribute("ServiceDisplayName", config.getServiceDisplayName());
+        }
+
+        //http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd
+        //missing organization, contactperson
+
+        //KeyDescriptor
+        writer.writeStartElement("", "KeyDescriptor", SAML2_METADATA_NS);
+        writer.writeAttribute("use", "signing");
+        writer.writeStartElement("", "KeyInfo", "http://www.w3.org/2000/09/xmldsig#");
+        writer.writeStartElement("", "X509Data", "http://www.w3.org/2000/09/xmldsig#");
+        writer.writeStartElement("", "X509Certificate", "http://www.w3.org/2000/09/xmldsig#");
+
+        try {
+            String keyAlias = crypto.getDefaultX509Identifier();
+            X509Certificate cert = CertsUtils.getX509Certificate(crypto, keyAlias);
+            writer.writeCharacters(Base64.encode(cert.getEncoded()));
+        } catch (Exception ex) {
+            LOG.error("Failed to add certificate information to metadata. Metadata incomplete",
ex);
+        }
+
+        writer.writeEndElement(); // X509Certificate
+        writer.writeEndElement(); // X509Data
+        writer.writeEndElement(); // KeyInfo
+        writer.writeEndElement(); // KeyDescriptor
+
+
+        // SecurityTokenServiceEndpoint
+        writer.writeStartElement("fed", "SecurityTokenServiceEndpoint", WS_FEDERATION_NS);
+        writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
+
+        writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
+        writer.writeCharacters(config.getStsUrl().toString());
+
+        writer.writeEndElement(); // Address
+        writer.writeEndElement(); // EndpointReference
+        writer.writeEndElement(); // SecurityTokenServiceEndpoint
+
+
+        // PassiveRequestorEndpoint
+        writer.writeStartElement("fed", "PassiveRequestorEndpoint", WS_FEDERATION_NS);
+        writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
+
+        writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
+        writer.writeCharacters(config.getIdpUrl().toString());
+
+        writer.writeEndElement(); // Address
+        writer.writeEndElement(); // EndpointReference
+        writer.writeEndElement(); // PassiveRequestorEndpoint
+
+
+        // create ClaimsType section
+        if (config.getClaimTypesOffered() != null && config.getClaimTypesOffered().size()
> 0) {
+            writer.writeStartElement("fed", "ClaimTypesOffered", WS_FEDERATION_NS);
+            for (Claim claim : config.getClaimTypesOffered()) {
+
+                writer.writeStartElement("auth", "ClaimType", WS_FEDERATION_NS);
+                writer.writeAttribute("Uri", claim.getClaimType().toString());
+                writer.writeAttribute("Optional", "true");
+                writer.writeEndElement(); // ClaimType
+
+            }
+            writer.writeEndElement(); // ClaimTypesOffered
+        }
+
+        writer.writeEndElement(); // RoleDescriptor
+    }
+
+ 
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e52520d9/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
deleted file mode 100644
index 88f0547..0000000
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/util/MetadataWriter.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.fediz.service.idp.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.security.cert.X509Certificate;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.w3c.dom.Document;
-import org.apache.cxf.fediz.core.util.CertsUtils;
-import org.apache.cxf.fediz.core.util.SignatureUtils;
-import org.apache.cxf.fediz.service.idp.domain.Claim;
-import org.apache.cxf.fediz.service.idp.domain.Idp;
-import org.apache.wss4j.common.crypto.Crypto;
-import org.apache.xml.security.stax.impl.util.IDGenerator;
-import org.apache.xml.security.utils.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.cxf.fediz.core.FedizConstants.SAML2_METADATA_NS;
-import static org.apache.cxf.fediz.core.FedizConstants.SCHEMA_INSTANCE_NS;
-import static org.apache.cxf.fediz.core.FedizConstants.WS_ADDRESSING_NS;
-import static org.apache.cxf.fediz.core.FedizConstants.WS_FEDERATION_NS;
-
-public class MetadataWriter {
-    
-    private static final Logger LOG = LoggerFactory.getLogger(MetadataWriter.class);
-    
-    private static final XMLOutputFactory XML_OUTPUT_FACTORY = XMLOutputFactory.newInstance();
-    private static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
-    
-    static {
-        DOC_BUILDER_FACTORY.setNamespaceAware(true);
-    }
-
-    //CHECKSTYLE:OFF
-    public Document getMetaData(Idp config) throws RuntimeException {
-        //Return as text/xml
-        try {
-            Crypto crypto = CertsUtils.createCrypto(config.getCertificate());
-            
-            ByteArrayOutputStream bout = new ByteArrayOutputStream(4096);
-            Writer streamWriter = new OutputStreamWriter(bout, "UTF-8");
-            XMLStreamWriter writer = XML_OUTPUT_FACTORY.createXMLStreamWriter(streamWriter);
-
-            writer.writeStartDocument("UTF-8", "1.0");
-
-            String referenceID = IDGenerator.generateID("_");
-            writer.writeStartElement("md", "EntityDescriptor", SAML2_METADATA_NS);
-            writer.writeAttribute("ID", referenceID);
-                      
-            writer.writeAttribute("entityID", config.getIdpUrl().toString());
-
-            writer.writeNamespace("md", SAML2_METADATA_NS);
-            writer.writeNamespace("fed", WS_FEDERATION_NS);
-            writer.writeNamespace("wsa", WS_ADDRESSING_NS);
-            writer.writeNamespace("auth", WS_FEDERATION_NS);
-            writer.writeNamespace("xsi", SCHEMA_INSTANCE_NS);
-            
-            writeFederationMetadata(writer, config, crypto);
-            
-            writer.writeEndElement(); // EntityDescriptor
-
-            writer.writeEndDocument();
-            streamWriter.flush();
-            bout.flush();
-
-            if (LOG.isDebugEnabled()) {
-                String out = new String(bout.toByteArray());
-                LOG.debug("***************** unsigned ****************");
-                LOG.debug(out);
-                LOG.debug("***************** unsigned ****************");
-            }
-            
-            InputStream is = new ByteArrayInputStream(bout.toByteArray());
-            
-            Document result = SignatureUtils.signMetaInfo(crypto, null, config.getCertificatePassword(),
is, referenceID);
-            if (result != null) {
-                return result;
-            } else {
-                throw new RuntimeException("Failed to sign the metadata document: result=null");
-            }
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            LOG.error("Error creating service metadata information ", e);
-            throw new RuntimeException("Error creating service metadata information: " +
e.getMessage());
-        }
-        
-    }
-    
-    private void writeFederationMetadata(
-        XMLStreamWriter writer, Idp config, Crypto crypto
-    ) throws XMLStreamException {
-
-        writer.writeStartElement("md", "RoleDescriptor", WS_FEDERATION_NS);
-        writer.writeAttribute(SCHEMA_INSTANCE_NS, "type", "fed:SecurityTokenServiceType");
-        writer.writeAttribute("protocolSupportEnumeration", WS_FEDERATION_NS);
-        if (config.getServiceDescription() != null && config.getServiceDescription().length()
> 0 ) {
-            writer.writeAttribute("ServiceDescription", config.getServiceDescription());
-        }
-        if (config.getServiceDisplayName() != null && config.getServiceDisplayName().length()
> 0 ) {
-            writer.writeAttribute("ServiceDisplayName", config.getServiceDisplayName());
-        }
-
-        //http://docs.oasis-open.org/security/saml/v2.0/saml-schema-metadata-2.0.xsd
-        //missing organization, contactperson
-
-        //KeyDescriptor
-        writer.writeStartElement("", "KeyDescriptor", SAML2_METADATA_NS);
-        writer.writeAttribute("use", "signing");
-        writer.writeStartElement("", "KeyInfo", "http://www.w3.org/2000/09/xmldsig#");
-        writer.writeStartElement("", "X509Data", "http://www.w3.org/2000/09/xmldsig#");
-        writer.writeStartElement("", "X509Certificate", "http://www.w3.org/2000/09/xmldsig#");
-
-        try {
-            String keyAlias = crypto.getDefaultX509Identifier();
-            X509Certificate cert = CertsUtils.getX509Certificate(crypto, keyAlias);
-            writer.writeCharacters(Base64.encode(cert.getEncoded()));
-        } catch (Exception ex) {
-            LOG.error("Failed to add certificate information to metadata. Metadata incomplete",
ex);
-        }
-
-        writer.writeEndElement(); // X509Certificate
-        writer.writeEndElement(); // X509Data
-        writer.writeEndElement(); // KeyInfo
-        writer.writeEndElement(); // KeyDescriptor
-
-
-        // SecurityTokenServiceEndpoint
-        writer.writeStartElement("fed", "SecurityTokenServiceEndpoint", WS_FEDERATION_NS);
-        writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
-
-        writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
-        writer.writeCharacters(config.getStsUrl().toString());
-
-        writer.writeEndElement(); // Address
-        writer.writeEndElement(); // EndpointReference
-        writer.writeEndElement(); // SecurityTokenServiceEndpoint
-
-
-        // PassiveRequestorEndpoint
-        writer.writeStartElement("fed", "PassiveRequestorEndpoint", WS_FEDERATION_NS);
-        writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
-
-        writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);
-        writer.writeCharacters(config.getIdpUrl().toString());
-
-        writer.writeEndElement(); // Address
-        writer.writeEndElement(); // EndpointReference
-        writer.writeEndElement(); // PassiveRequestorEndpoint
-
-
-        // create ClaimsType section
-        if (config.getClaimTypesOffered() != null && config.getClaimTypesOffered().size()
> 0) {
-            writer.writeStartElement("fed", "ClaimTypesOffered", WS_FEDERATION_NS);
-            for (Claim claim : config.getClaimTypesOffered()) {
-
-                writer.writeStartElement("auth", "ClaimType", WS_FEDERATION_NS);
-                writer.writeAttribute("Uri", claim.getClaimType().toString());
-                writer.writeAttribute("Optional", "true");
-                writer.writeEndElement(); // ClaimType
-
-            }
-            writer.writeEndElement(); // ClaimTypesOffered
-        }
-
-        writer.writeEndElement(); // RoleDescriptor
-    }
-
- 
-}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e52520d9/services/idp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/services/idp/src/main/webapp/WEB-INF/web.xml b/services/idp/src/main/webapp/WEB-INF/web.xml
index b7ec9ec..a65068a 100644
--- a/services/idp/src/main/webapp/WEB-INF/web.xml
+++ b/services/idp/src/main/webapp/WEB-INF/web.xml
@@ -90,6 +90,7 @@ under the License.
 	<servlet-mapping>
 		<servlet-name>metadata</servlet-name>
 		<url-pattern>/FederationMetadata/2007-06/FederationMetadata.xml</url-pattern>
+		<url-pattern>/metadata/*</url-pattern>
 	</servlet-mapping>
 
     <servlet>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e52520d9/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java
----------------------------------------------------------------------
diff --git a/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java
b/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java
index a1fd5e5..85c369b 100644
--- a/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java
+++ b/services/idp/src/test/java/org/apache/cxf/fediz/service/idp/util/MetadataWriterTest.java
@@ -21,6 +21,7 @@ package org.apache.cxf.fediz.service.idp.util;
 
 import org.w3c.dom.Document;
 import org.apache.cxf.fediz.service.idp.domain.Idp;
+import org.apache.cxf.fediz.service.idp.metadata.IdpMetadataWriter;
 import org.apache.cxf.fediz.service.idp.service.ConfigService;
 import org.apache.wss4j.common.util.DOM2Writer;
 import org.junit.BeforeClass;
@@ -45,7 +46,7 @@ public class MetadataWriterTest {
         Idp idpConfig = config.getIDP("urn:org:apache:cxf:fediz:idp:realm-A");
         Assert.notNull(idpConfig, "IDPConfig must not be null");
         
-        MetadataWriter writer = new MetadataWriter();
+        IdpMetadataWriter writer = new IdpMetadataWriter();
         Document doc = writer.getMetaData(idpConfig);
         Assert.notNull(doc, "doc must not be null");
         


Mime
View raw message