【发布时间】:2014-09-08 11:07:52
【问题描述】:
通常我基于 Spring SAML 的 Service 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。
【问题讨论】:
-
我认为您错过了 idp 端点中配置的协议中的“s”。您期望“https”,但您似乎收到“http”。
-
当前配置正常工作,只是有时会导致上述错误。我在想问题是别的。也许我必须手动设置元数据,也许我错过了某个设置(我只是假设)。
-
该链接给了我一个“Whitelabel 错误页面”。它不是元数据。此外,当您说“通常工作正常”时,这是有线的,它应该总是或永远不会工作!我想这与协议有关。也许有时您从 http 连接,有时从 https 连接。而且您的 idp 似乎期望 https。
-
只有一个“7”而不是“/”
标签: spring spring-security saml saml-2.0 spring-saml