gpt4 book ai didi

java - 我们是否应该在 SAML 中使用任何压缩技术,例如 Deflater to

转载 作者:行者123 更新时间:2023-11-29 05:29:36 37 4
gpt4 key购买 nike

我正在尝试在 SAML 中使用 OPENSAML-java 生成 SP 端

虽然在过程中注意到 Limitations Of URL Length .

那么在我将它发送到 TestIdP 之前,是否必须对 SAML 消息使用任何压缩技术?

如果我们使用任何压缩技术,IdP 如何知道 SP 使用这种压缩技术来解压请求消息。

元数据中有没有这方面的规定?

感谢示例代码。谢谢。

最佳答案

作为Wiki状态:

SAML protocol messages are often carried directly in the URL query string of an HTTP GET request. Since the length of URLs is limited in practice, the HTTP Redirect binding is suitable for short messages, such as the message. Longer messages (e.g., those containing signed SAML assertions) should be transmitted via other bindings such as the HTTP POST Binding.

SAML requests or responses transmitted via HTTP Redirect have a SAMLRequest or SAMLResponse query string parameter, respectively. Before it’s sent, the message is deflated, base64-encoded, and URL-encoded, in that order. Upon receipt, the process is reversed to recover the original message.

HTTP GET 示例长度少于 600 个字符:

https://idp.example.org/SAML2/SSO/Redirect?SAMLRequest=fZFfa8IwFMXfBb9DyXvaJtZ1BqsURRC2Mabbw95ivc5Am3TJrXPffmmLY3%2FA15Pzuyf33On8XJXBCaxTRmeEhTEJQBdmr%2FRbRp63K3pL5rPhYOpkVdYib%2FCon%2BC9AYfDQRB4WDvRvWWksVoY6ZQTWlbgBBZik9%2FfCR7GorYGTWFK8pu6DknnwKL%2FWEetlxmR8sBHbHJDWZqOKGdsRJM0kfQAjCUJ43KX8s78ctnIz%2Blp5xpYa4dSo1fjOKGM03i8jSeCMzGevHa2%2FBK5MNo1FdgN2JMqPLmHc0b6WTmiVbsGoTf5qv66Zq2t60x0wXZ2RKydiCJXh3CWVV1CWJgqanfl0%2Bin8xutxYOvZL18NKUqPlvZR5el%2BVhYkAgZQdsA6fWVsZXE63W2itrTQ2cVaKV2CjSSqL1v9P%2FAXv4C

如果您使用的是 HTTP POST,请求的参数将转到正文。所以完全没问题。

但是您真的应该检查消息 SAMLRequest 是否不太长。

安全注意事项:由于使用 HTTP GET,整个请求及其参数都会记录在任何 http 访问日志中,因此您真的应该使用 POST。

关于java - 我们是否应该在 SAML 中使用任何压缩技术,例如 Deflater to <AuthnRequest>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21576482/

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