【问题标题】:SAML Request without service provider certificate没有服务提供商证书的 SAML 请求
【发布时间】:2020-02-04 16:59:03
【问题描述】:

我使用https://github.com/oktadeveloper/okta-spring-boot-saml-example实现了spring boot security saml示例

它与 Okta IdP 合作。

但是,我想向我自己的 IdP 发送没有服务提供商证书的 SAML 请求。

您能帮我禁用服务提供商证书吗?

请在下面找到配置代码:

@覆盖 protected void configure(final HttpSecurity http) 抛出异常 {

    http.authorizeRequests().antMatchers("/saml*").permitAll().anyRequest().authenticated().and().apply(saml())
            .serviceProvider().keyStore().storeFilePath(this.keyStoreFilePath).password(this.password)
            .keyname(this.keyAlias).keyPassword(this.password).and().protocol("https")
            .hostname(String.format("%s:%s", "localhost", this.port)).basePath("/").and().identityProvider()
            .metadataFilePath(this.metadataUrl);

}

请在下面找到示例 SAMLrequest:

【问题讨论】:

    标签: spring-boot spring-security saml-2.0 spring-saml spring-dsl


    【解决方案1】:

    但是,我想发送没有服务提供商证书的 SAML 请求 到我自己的 IdP。

    仅当使用 HTTP POST 绑定并且 SAML AuthnRequest 需要进行数字签名时才会发送证书。

    检查 IdP 元数据文件并从 IDPSSODescriptor 中删除属性 WantAuthnRequestsSigned="true"

    【讨论】:

    • 不走运@Bernhard Thalmayr,我从 IdP 元数据文件中删除了 WantAuthnRequestsSigned="true",并尝试使用 WantAuthnRequestsSigned="false"。但我只获得带有签名证书的 SAML AuthnRequest。
    • 我希望通过以下代码禁用 SP 证书:protected void configure(final HttpSecurity http) { http.authorizeRequests().antMatchers("/saml*").permitAll().anyRequest().authenticated().and().apply(saml()) .serviceProvider().keyStore().storeFilePath(this.keyStoreFilePath).password(this.password) .keyname(this.keyAlias).keyPassword(this.password).and().protocol("https") .hostname(String.format("%s:%s", "localhost", this.port)).basePath("/").and().identityProvider() .metadataFilePath(this.metadataUrl); }
    • 实际上不需要更改代码,但是如果您删除与密钥相关的调用,SP 将无法使用私钥,因此无法签署 SAML AuthnRequest。如果您有 SAML SP 元数据,那么还要检查 SPSSODescriptor 是否没有设置 AuthnRequestsSigned="true"
    • 我没有任何 SP 元数据,请检查我附加的 SAMLRequest 图像,我期待没有签名。生成 SAMLRequest 时是否有要禁用的标志?
    • 该图显示了一个解码的 SAML AuthnRequest,它没有经过数字签名。您可能正在使用 HTTP REDIRECT 绑定,然后通过 http 请求参数 Signature 和作为 http 请求参数 SigAlg 的签名算法提供数字签名(根据 SAML 规范)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-01
    • 1970-01-01
    • 2013-05-12
    • 2014-04-04
    • 2011-07-27
    相关资源
    最近更新 更多