Search code examples
spring-bootspring-securitysamlsaml-2.0

spring-boot saml: configure service provider entityId


Is there a way to configure the entityID of the service provider in the following configuration:

spring:
  security:
    saml2:
      relyingparty:
        registration:
          myapp:
            signing:
              credentials:
                - private-key-location: "classpath:private.pem"
                  certificate-location: "classpath:public.pem"
            identityprovider:
              entity-id: idp
              singlesignon:
                sign-request: false
                url: https://.../auth/realms/saml-demo/protocol/saml

Currently the identity provider is always receiving the following format:

{baseUrl}/saml2/service-provider-metadata/{registrationId}

For example:

http://localhost:8080/saml2/service-provider-metadata/myapp

Can this format be customized when using the yaml config?


Solution

  • Hello this is how it works.

    spring:
      security:
        saml2:
          relyingparty:
            registration:
              myapp:
                signing:
                  credentials:
                    - private-key-location: "classpath:private.pem"
                      certificate-location: "classpath:public.pem"
                entity-id: "http://localhost:8080/saml2/service-provider-metadata/myapp"
    

    Don't use the identityprovide. Just add the entity-id and it just works. The official documentation is wrong. From what I see.