我一直在使用一些教程来了解必须在 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 属性相关的文档吗?例如,最后一个属性不正确。我想创建一个包含元数据的文件并在 application.yml 中使用它,而不是 URI,但我不知道属性名称是什么。
拥有一个网页,其中包含有关可在 application.yml 中设置的 SAML 2 属性的文档,这将很有帮助。
我认为你可以推断出类中参数的全部数量
RelayingPartyRegistration
这是注册实例化的内容:
事实上,有一些方法可以让您手动将注册添加为一个类,而不是添加属性,在这种情况下,这种限制应该是显而易见的。在此处查看示例 130:https://docs.spring.io/spring-security/site/docs/current/reference/html5/#servlet-saml2login-sansboot
我想用元数据创建一个文件并在 application.yml 但我不知道属性名称是什么。
我能够将
file:///
URI 前缀用于相同的 metadata-uri
属性值。例如,不同 Windows 计算机上的元数据文件:
metadata-uri: file:///\\server\share_name$\path\to\file\metadata.xml
您可以针对同一服务器上的文件进行调整,并仅提供绝对路径。
我一直在使用一些教程来理解什么属性必须是 在 application.yml 中设置。好像没有 有关可以设置的完整属性集的文档
同情,我有同样的问题。
可以从 Spring Security config.xsd 中获取属性(这不是指 XML 配置,您可以在那里获取属性): https://github.com/spring-projects/spring-security/tree/main/config/src/main/resources/org/springframework/security/config
例如可以查看Spring Security 6.1的RNC文件: https://github.com/spring-projects/spring-security/blob/main/config/src/main/resources/org/springframework/security/config/spring-security-6.1.rnc#L683
当然你仍然需要做一些翻译,但我认为既然你已经知道了一些属性,那么你做起来就很简单了。
关于文件的位置——我同意,但我认为是:
metadata-location: file:/home/user/okta-metadata.xml
正如其他人所指出的,您还可以将 metadata-uri 与 file:/// 一起使用 ... 注意元数据位置在文件之后没有//: