ATrubka
ATrubka

Reputation: 4004

Yaml configuration list of objects to properties file

I'm trying to convert the following yaml configuration for SAML2 security to and equivalent properties file.

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"

It contains lists and it's not obvious how to convert it to properties. I couldn't find much online about it.

This portion of the config file configures the following class:

org.springframework.boot.autoconfigure.security.saml2.Saml2RelyingPartyProperties

From the spring-boot-autoconfigure-2.2.5.RELEASE.jar.

Upvotes: 2

Views: 1303

Answers (1)

pvpkiran
pvpkiran

Reputation: 27078

Try this out. This should work

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

Upvotes: 2

Related Questions