gpt4 book ai didi

spring - 收件人端点与 SAML 响应不匹配

转载 作者:IT老高 更新时间:2023-10-28 13:45:43 29 4
gpt4 key购买 nike

通常我的基于 Spring SAMLService Provider (SP) 实现工作正常,但有时它会返回此错误:

[2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseMessageDecoder:     Successfully decoded message.
[2014-07-17 16:00:58.767] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Checking SAML message intended destination endpoint against receiver endpoint
[2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Intended message destination endpoint: https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
[2014-07-17 16:00:58.768] boot - 1078 DEBUG [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: Actual message receiver endpoint: http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias
[2014-07-17 16:00:58.768] boot - 1078 ERROR [http-bio-80-exec-1] --- BaseSAMLMessageDecoder: SAML message intended destination endpoint 'https://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias' did not match the recipient endpoint 'http://prismasp.cloud.reply.eu:443/MIUR_PRISMA-2.1-WEBUI/saml/SSO/alias/defaultAlias'
[2014-07-17 16:00:58.782] boot - 1078 DEBUG [http-bio-80-exec-1] --- SAMLProcessingFilter: Incoming SAML message is invalid
org.opensaml.xml.security.SecurityException: SAML message intended destination endpoint did not match recipient endpoint
...

我在 Tomcat 7 上使用(作为 Spring Security 的默认设置)HTTP Strict Transport Security (HSTS)>SSL 已启用。

有没有办法修复这个错误?


注意:示例源代码在 Github 上: vdenotaris/spring-boot-security-saml-sample

最佳答案

我不知道您的问题为什么会随机发生,但至少一种解决方法是配置 SAMLContextProviderLB 而不是您当前的 SAMLContextProviderImpl

SAMLContextProviderLB 通常用于告诉 Spring SAML public 关于反向代理或负载均衡器上使用的公共(public) URL,但在这种情况下,您可以使用它来强制 Spring SAML 认为它正在使用 HTTPS。您可以在Spring SAML manual10.1 高级配置一章中找到详细信息。 .

您还应该确保在 MetadataGenerator bean 上正确设置属性 entityBaseURL,因为如果不这样做,生成的元数据将取决于您是否向应用程序发出了第一个请求使用 http 或 https。同样,所有这些都是 documented .

关于spring - 收件人端点与 SAML 响应不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24805895/

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