コード例 #1
0
        internal static MetadataBase Load(XmlDictionaryReader reader)
        {
            var serializer = ExtendedMetadataSerializer.ReaderInstance;

            // Filter out the signature from the metadata, as the built in MetadataSerializer
            // doesn't handle the XmlDsigNamespaceUrl http://www.w3.org/2000/09/xmldsig# which
            // is allowed (and for SAMLv1 even recommended).
            using (var filter = new FilteringXmlDictionaryReader(SignedXml.XmlDsigNamespaceUrl, "Signature", reader))
            {
                return(serializer.ReadMetadata(filter));
            }
        }
コード例 #2
0
ファイル: MetadataLoader.cs プロジェクト: Hotkey/authservices
 internal static MetadataBase Load(Stream metadataStream)
 {
     var serializer = ExtendedMetadataSerializer.ReaderInstance;
     using (var reader = XmlDictionaryReader.CreateTextReader(metadataStream, XmlDictionaryReaderQuotas.Max))
     {
         // Filter out the signature from the metadata, as the built in MetadataSerializer
         // doesn't handle the XmlDsigNamespaceUrl http://www.w3.org/2000/09/xmldsig# which
         // is allowed (and for SAMLv1 even recommended).
         using (var filter = new FilteringXmlDictionaryReader(SignedXml.XmlDsigNamespaceUrl, "Signature", reader))
         {
             return serializer.ReadMetadata(filter);
         }
     }
 }