Search code examples
spring-securityoktaspring-security-saml2

SAML 2.0 properties in application.yml


I have been using some tutorials to understand what properties must be set in the application.yml. There does not seem to be any documentation on the complete set of properties that can be set. Here's an example

  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"

Does anyone know of documentation related to which SAML properties I can set ? For example the last property is not correct. Instead of a URI, I wanted to create a file with the metadata and use that in the application.yml but I dont know what the property name is.

It would be helpful to have a webpage with documentation on the SAML 2 properties that can be set in application.yml.


Solution

  • I think you can deduce the full number of parameters in the class RelayingPartyRegistration which is what a registration is instantiated into:

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

    As a matter of fact, there are ways in which you instead of adding properties add the registration as a class manually in which case this restriction should be obvious. Check example 130 here : https://docs.spring.io/spring-security/site/docs/current/reference/html5/#servlet-saml2login-sansboot