我有一個應用程序,我試圖與Federated Security - 特別是Siteminder集成。我正在使用這裏找到的PHP-SAML工具包:https://github.com/onelogin/php-saml如何使用PHP解密SAML?
我在應用程序中包含了x509證書,並且所有工作都很好,直到在Siteminder環境中打開加密。一旦被打開,我再也不能登錄 - 我收到這樣的信息:無效的SAML響應:無法定位簽名節點
我已經能夠確定的是,SAML斷言發送到來自Siteminder的應用程序被加密。我能夠看到斷言(下面的示例)。不幸的是,我無法弄清楚如何解密該消息,以便我可以解析並在我的應用程序中使用。
<Response xmlns="urn:oasis:names:tc:SAML:2.0:protocol"
Destination="{VALUE HERE}"
ID="_076e8f69ec4adb3b72f0cc76570527222e37"
IssueInstant="2013-01-15T18:18:48Z"
Version="2.0"
>
<ns1:Issuer xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
>{VALUE HERE}</ns1:Issuer>
<Status>
<StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
</Status>
<ns2:EncryptedAssertion xmlns:ns2="urn:oasis:names:tc:SAML:2.0:assertion">
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
Type="http://www.w3.org/2001/04/xmlenc#Element"
>
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<xenc:CipherData>
<xenc:CipherValue>{VALUE HERE}</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedKey>
<ds:X509Data>
<ds:X509Certificate>
{CERTIFICATE HERE}
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>{VALUE HERE}</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</ns2:EncryptedAssertion>
</Response>
如果任何人都可以提供幫助,那將是驚人的。
嗨。你能解密你的XML嗎?我也有同樣的問題 – gkalikapersaud
@ GK123512648是第三方庫的一個選項?如果您可以在服務器上安裝擴展程序,我們的用於PHP的SecureBlackbox庫可以完成這項工作。 –