【发布时间】:2018-05-07 05:51:22
【问题描述】:
我用 C++ 编写了 saml SP,但不知道如何压缩 xml。
http://acme.com:16006/idp/samlv20?SAMLRequest={xmlCompressedandBase64encodedString}
现在xmlCompressedandBase64encodedString 是有问题的部分,我知道 Base64 编码,但 xml 压缩我不知道。
我的 saml 请求将如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<samlp:AuthnRequest
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns:enc="http://www.w3.org/2001/04/xmlenc#"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:x500="urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
ID="id-_Abcd1234&-rQjG"
Version="2.0"
IssueInstant="2018-05-03T06:02:22Z"
Destination="http://acme.com:16006/idp/samlv20">
<saml:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
https://flight.com::14213/sp
</saml:Issuer>
<samlp:NameIDPolicy AllowCreate="true"/>
</samlp:AuthnRequest>
SamlRespone 的解压也是如此。
【问题讨论】: