我正在尝试将以下 SAML2 安全性的 yaml 配置转换为等效属性文件。
spring:
security:
saml2:
relyingparty:
registration:
xyz:
signing:
credentials:
- certificate-location: "classpath:saml/xyz.pem"
private-key-location: "classpath:saml/xyz.key"
identityprovider:
entity-id: xyz
sso-url: xyz.com
verification:
credentials:
- certificate-location: "classpath:saml/xyz.pem"
它包含列表,但如何将其转换为属性并不明显。 我在网上找不到太多相关信息。
配置文件的这一部分配置以下类:
org.springframework.boot.autoconfigure.security.saml2.Saml2RelyingPartyProperties
来自 spring-boot-autoconfigure-2.2.5.RELEASE.jar。
最佳答案
试试这个。这应该有效
spring.security.saml2.relyingparty.registration.xyz.signing.credentials[0].certificate-location=classpath:saml/xyz.pem
spring.security.saml2.relyingparty.registration.xyz.signing.credentials[0].private-key-location=classpath:saml/xyz.key
spring.security.saml2.relyingparty.registration.xyz.identityprovider.entity-id=xyz
spring.security.saml2.relyingparty.registration.xyz.identityprovider.sso-url=xyz.com
spring.security.saml2.relyingparty.registration.xyz.identityprovider.verification.credentials[0].certificate-location=classpath:saml/xyz.pem
关于java - 将对象的 Yaml 配置列表添加到属性文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60857526/