【问题标题】:SAML assertion failsSAML 断言失败
【发布时间】:2018-11-09 20:39:51
【问题描述】:

我有一个使用 Okta 作为 IDP 的 Spring-SAML 应用程序。我正在做 IDP 发起的流程和 得到这个例外:

org.opensaml.common.SAMLException: Endpoint with message binding urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST and URL https://<myCompanyUrl>.com/saml/SSO wasn't found in local metadata

当我查看本地元数据时,我看到:

 <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                                 Location="https://<server IP address> :<server port>/saml/SSO" index="0" isDefault="true"/>

看起来它正在尝试将包含主机名的 URL 与具有服务器 IP 地址的 URL 匹配。位置字段是自动生成的。有人知道什么配置选项会影响这个吗?


更新 1

这是我的 metadataGeneratorFilter 配置:

<bean id="metadataGeneratorFilter" class="org.springframework.security.saml.metadata.MetadataGeneratorFilter">
    <constructor-arg>
        <bean class="org.springframework.security.saml.metadata.MetadataGenerator">
            <property name="entityId" value="https://myHostname/myApp"/>
        </bean>
    </constructor-arg>
</bean>

【问题讨论】:

  • 看起来在 Okta 的通用 SAML 设置中有一个选项,称为 URL 上的单一登录

标签: spring-security saml-2.0 spring-saml okta spring-security-saml2


【解决方案1】:

好吧,谜团解开了:

根据 Spring-SAML 文档,当您处于反向代理/负载平衡器设置中时,您必须确保指定

<property name="entityBaseURL" value="https://www.myserver.com/spring-security-saml2-sample"/>

SPRING-SAML documentation 10.1 反向代理和负载均衡器

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-27
    • 1970-01-01
    • 2021-03-16
    • 2010-09-26
    • 2021-01-20
    • 2014-06-10
    相关资源
    最近更新 更多