gpt4 book ai didi

xml - SAML 响应 xml 无效

转载 作者:行者123 更新时间:2023-12-02 03:02:46 24 4
gpt4 key购买 nike

我为我们的一位客户开发了自定义 SAML IdP。但是,当尝试将以下响应传递给 SP 时,它会失败。我尝试使用在线提供的一些 SAML 在线工具验证响应,我发现了一些错误,但我无法弄清楚哪里出了问题。有人可以帮忙吗?

    <Response xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_8ad9eb0c-c65c-4327-ae76-ae238ca17e96"
Version="2.0"
IssueInstant="2017-06-28T13:53:06.9612024Z"
Destination="https://crnm.lessonly.com/auth/saml/callback"
xmlns="urn:oasis:names:tc:SAML:2.0:protocol"
>
<saml:Issuer>https://crnm.lessonly.com/auth/saml/metadata</saml:Issuer>
<Status>
<StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</Status>
<saml:Assertion Version="2.0"
ID="_4761e320-64e8-4d8a-a443-2e4e2ccb3e98"
IssueInstant="2017-06-28T13:53:06.9612024Z"
>
<saml:Issuer>https://crnm.lessonly.com/auth/saml/metadata</saml:Issuer>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">amilev1@visualantidote.com</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData Recipient="https://crnm.lessonly.com/auth/saml/callback"
NotOnOrAfter="2017-06-28T13:58:06.9768269Z"
/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2017-06-28T13:53:06.9768269Z"
NotOnOrAfter="2017-06-28T13:58:06.9768269Z"
>
<saml:AudienceRestriction>
<saml:Audience>https://crnm.lessonly.com/auth/saml/metadata</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2017-06-28T13:53:06.9768269Z"
SessionIndex="_4761e320-64e8-4d8a-a443-2e4e2ccb3e98"
>
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute Name="UserID"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml:AttributeValue xsi:type="xsd:string">125481</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="email"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml:AttributeValue xsi:type="xsd:string">amilev1@visualantidote.com</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="first_name"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml:AttributeValue xsi:type="xsd:string">Angel1</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="last_name"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml:AttributeValue xsi:type="xsd:string">Milev1</saml:AttributeValue>
</saml:Attribute>
<saml:Attribute Name="name"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml:AttributeValue xsi:type="xsd:string">Angel1 Milev1</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="#_4761e320-64e8-4d8a-a443-2e4e2ccb3e98">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>UB/5XN1dGa2/w0aKRmmq2oFvbOE=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>JTkUhfmk2ngPQnFtSC41WQodJj0MyCHw8oCJbEQE32vgViV4ucVvaim4jKMMD6B7JIkvCtuyu8II5h6oJOSsXQK0x03hlQFqpdgj/1Be53v9H90PWTgJ1mr41jF2AQTgAcdJmuV05oI23KxI+5jNFifri+POHSEfRU+k0Phyh+UTA2DlhFnbn5DAjzhnIu4e+L35QJBCSwZy7zT+NDr7dzL/JLAQOC79PlaM4cbjn9ri2bUwS3T1QFMQqsxGOl+ggaAwGWWNQlCV2Se2tZ1rLVUpZ5lB611GIbysBmghy5gtDe3htDHsp8IkuJnRf4lndjral7FVmZ1pdPhdK7HTgTA=</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>MIIDUTCCAjigAwIBAgIBADANBgkqhkiG9w0BAQ0FADBCMQswCQYDVQQGEwJjYTERMA8GA1UECAwITWFuaXRvYmExDTALBgNVBAoMBENSTk0xETAPBgNVBAMMCENSTk0uQ09NMB4XDTE3MDYyMTE5MzEzNloXDTI3MDYxOTE5MzEzNlowQjELMAkGA1UEBhMCY2ExETAPBgNVBAgMCE1hbml0b2JhMQ0wCwYDVQQKDARDUk5NMREwDwYDVQQDDAhDUk5NLkNPTTCCASMwDQYJKoZIhvcNAQEBBQADggEQADCCAQsCggECAPbVJtzJTRQvSkAOl8sGUymWy0K1yNKI11Vf8eDnHiH/awkgSu9JORwochJdHPnTA8qA1KaH7IxIIZX8wYkXsE9OxRkUAv+xWHemVBRrUc64wlotfghCCziaPuhinPKxQ63BlIkj0u/KOmdXcGvOfYasBK0Gr4IVpL7X4CdXTDKQPF5Y6zV7Ed5lgjDcO3wG1klHGVSStOwIFptWzyArDMNCrOWqSbojzczjxcrESy8agTR1Z/U+YVhcwHub2ch0w/RkxepvtLQMHiTK3YtFrp5of29pCGHLv0dWgCoR+S7+VcSbQrQdAv1kb13EC64F55GwvJnPEcQGTous2DZrbsOnAgMBAAGjUDBOMB0GA1UdDgQWBBToNe5/YV0PcEjQJlvv/yJ7FhfvQjAfBgNVHSMEGDAWgBToNe5/YV0PcEjQJlvv/yJ7FhfvQjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBDQUAA4IBAgCPzeVaQNP3Bm796QT5R2r0Ur537xkN9f6W69paWfh2Ti7FzVyBCUMUMHL55dR24m45Xl7X2rurwZnr3oyibcCUENk2nYQ3uadoXTj3q5jfW2KxTx0DQH2F4D3TqxUpsTcJpt5eG+2mFheAyG6A+k719ShVgV6BtW1A1U9KJMD7UeWbejBGKrAC3AkCQyIaBjw+64sed8NN+jRPaEJxJ/APpHEBRiXQQOtnTKoRoz9ZvRvJTZ0N65/s+Cs7c2Y56PonWjlY2Kt4W5tp4VZTCmwnGmvMApyrWr/IZ9GgJsSz1EmbfVGKjKLHM29xXxnBLmkfGdc1yU4HXZYVFh00Ds6cgA==</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</saml:Assertion>
</Response>

在 samltool.com 上使用验证器时出现以下错误:

XML 无效。

第 69 行 |列:0 --> 元素 '{ http://www.w3.org/2000/09/xmldsig# }Signature':不需要此元素。

最佳答案

SAML XSD 要求 Signature 元素紧跟在 Issuer 元素之后

关于xml - SAML 响应 xml 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44804797/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com