【问题标题】:SAML 2.0 properties in application.ymlapplication.yml 中的 SAML 2.0 属性
【发布时间】:2021-11-13 18:59:13
【问题描述】:

我一直在使用一些教程来了解必须在 application.yml 中设置哪些属性。似乎没有关于可以设置的完整属性集的任何文档。这是一个例子

  security:
    saml2:
      relyingparty:
        registration:
          samlexample:
            signing:
              credentials:
                - private-key-location: "classpath:credentials/private.key"
                  certificate-location: "classpath:credentials/certificate.crt"
            decryption:
              credentials:
                - private-key-location: "classpath:credentials/private.key"
                  certificate-location: "classpath:credentials/certificate.crt"
            identityprovider:
              singlesignon:
                sign-request: false
#              metadata-uri: https://dev-2148273.okta.com/app/exk2iacdpvAt1bS3D5d7/sso/saml/metadata
                metadata-location: "classpath:okta-metadata.xml"

有谁知道与我可以设置哪些 SAML 属性相关的文档?例如最后一个属性不正确。我想创建一个包含元数据的文件而不是 URI,并在 application.yml 中使用它,但我不知道属性名称是什么。

拥有一个包含可在 application.yml 中设置的 SAML 2 属性文档的网页会很有帮助。

【问题讨论】:

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


    【解决方案1】:

    我认为您可以推断出 RelayingPartyRegistration 类中的全部参数数量,这就是注册实例化的内容:

    https://docs.spring.io/spring-security/site/docs/5.5.3/api/org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.html

    事实上,有一些方法可以手动添加注册作为类而不是添加属性,在这种情况下,这种限制应该是显而易见的。在此处查看示例 130:https://docs.spring.io/spring-security/site/docs/current/reference/html5/#servlet-saml2login-sansboot

    【讨论】:

    • 谢谢!这绝对是有帮助的。我可能不得不直接查看 Spring Security 代码,以了解此映射是如何从 yml 到 class 完成的。我绝对更喜欢在 YML 中设置属性。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-28
    • 1970-01-01
    • 2016-06-09
    • 2021-12-30
    • 2019-02-04
    • 2020-03-07
    • 2017-07-25
    相关资源
    最近更新 更多