【发布时间】:2015-07-23 15:39:18
【问题描述】:
我使用 openSaml 库创建了注销请求并添加了签名
<samlp:LogoutRequest ID="_f576971e-5123-49e4-8152-80653dcdfb1a"
IssueInstant="2015-07-23T15:21:42.254Z"
Reason="urn:oasis:names:tc:SAML:2.0:logout:user" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<samlp:Issuer xmlns:samlp="urn:oasis:names:tc:SAML:2.0:assertion">https://my_host/logout</samlp:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#_f576971e-5123-49e4-8152-80653dcdfb1a">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue/>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue/>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIIC...</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml2:NameID
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">_933c8876-9128-431f-b250-08975fde2a24</saml2:NameID>
<saml2p:SessionIndex xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">8ee4bf85-6792-42f5-b038-a3342a0e0e17</saml2p:SessionIndex>
</samlp:LogoutRequest>
我对此进行了编码并像 URL 一样发送到 ADFS 服务器:
https://ADFS_HOST/adfs/ls/SignOut.aspx?SAMLRequest=nVbbk...
但是,我从 ADFS 收到一个错误:
联合服务在处理 SAML 时遇到错误 身份验证请求。
其他数据异常详细信息:System.Xml.XmlException: MSIS0018:无法读取 SAML 协议消息,因为它包含 无效的数据。 ---> System.InvalidOperationException: 否 相应的起始元素是打开的。在 System.Xml.XmlBaseReader.ReadEndElement() 在 Microsoft.IdentityModel.Protocols.XmlSignature.SignedInfo.ReadFrom(XmlDictionaryReader 阅读器,TransformFactory(transformFactory))在 Microsoft.IdentityModel.Protocols.XmlSignature.Signature.ReadFrom(XmlDictionaryReader 读者)在 Microsoft.IdentityModel.Protocols.XmlSignature.EnvelopedSignatureReader.ReadSignature() 在 Microsoft.IdentityModel.Protocols.XmlSignature.EnvelopedSignatureReader.TryReadSignature() 在 Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadCommonElements(XmlReader reader, SamlMessage message) --- 内部异常堆栈跟踪结束 --- 在 Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadCommonElements(XmlReader 阅读器,SamlMessage 消息)在 Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadLogoutRequest(XmlReader 读者)在 Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadSamlMessage(XmlReader 阅读器,NamespaceContext 上下文)在 Microsoft.IdentityServer.Protocols.Saml.HttpSamlBindingSerializer.ReadProtocolMessage(字符串 编码的SamlMessage)在 Microsoft.IdentityServer.Protocols.Saml.Contract.SamlContractUtility.CreateSamlMessage(MSISSamlBindingMessage 消息)在 Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolManager.Logout(HttpSamlMessage logoutMessage,字符串 sessionState,字符串 logoutState,布尔值 partialLogout, Boolean isUrlTranslationNeeded, HttpSamlMessage& newLogoutMessage, String& newSessionState, String& newLogoutState, Boolean&validLogoutRequest)
而且我找不到关于这个问题的一些信息。
有什么想法吗?
【问题讨论】:
-
什么是 ADFS 版本?
-
ADFS 版本 - 6.3.0.0
标签: single-sign-on saml signature adfs opensaml