【问题标题】:spring security sasl: Unable to configure SSO urlspring security sasl:无法配置 SSO url
【发布时间】:2018-06-25 20:43:27
【问题描述】:

我正在使用来自 github 的以下 spring security saml repo: https://github.com/spring-projects/spring-security-saml/tree/master/sample

每当我尝试更新 SSO 网址时,例如localhost:8100/saml/ddo,而不是 /saml/sso,浏览器陷入无限循环。 (我已经按照自述文件中提到的步骤更新了 okta 上的 url 以及在应用程序中进行测试)

示例代码和配置包含在: Spring secuirty saml issue

编辑:

我按照以下答案的建议进行操作,但收到 传入的 SAML 消息无效。

在调试时发现SAMLProcessingFilter中的attemptAuthentication,添加的端点中的位置仍然包含/api/saml/SSO而不是/api/saml/ddo

这就是为什么SamlUtil 中的getEndpoint 方法会抛出以下行的异常:

throw new SAMLException("Endpoint with message binding " + messageBinding + " and URL " + requestURL + " wasn't found in local metadata");

因为 requestUrl 和端点位置不匹配。

我还检查了我的metadata.xml,但它不包含与这些网址相关的任何信息。

MetaDataGenerator 类方法getSAMLWebSSOProcessingFilterPath 中,samlWebSSOFilter 为空,这就是返回默认过滤器 url:/saml/SSO 的原因。我想弄清楚如何在运行时设置这个值? 我知道有一个名称为:setSamlWebSSOFilter 的方法,如果我在启动时提供 url /saml/ddo,一切正常。但如果在运行时更改配置,我将无法完成这项工作。

知道我该如何前进吗?

【问题讨论】:

标签: spring-security spring-saml


【解决方案1】:

将 bean samlWebSSOProcessingFilter 上的字段 filterProcessesUrl 设置为值 /saml/ddo 应该可以解决问题。

【讨论】:

  • 由于上述评论很长,我已将其添加为原始问题的一部分
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-11-20
  • 1970-01-01
  • 1970-01-01
  • 2015-12-28
  • 2015-06-05
  • 2018-11-20
  • 2017-06-15
相关资源
最近更新 更多