java.lang.Object
org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration
Direct Known Subclasses:
OpenSamlRelyingPartyRegistration

public class RelyingPartyRegistration extends Object
Represents a configured relying party (aka Service Provider) and asserting party (aka Identity Provider) pair.

Each RP/AP pair is uniquely identified using a registrationId, an arbitrary string.

A fully configured registration may look like:

        String registrationId = "simplesamlphp";

        String relyingPartyEntityId = "{baseUrl}/saml2/service-provider-metadata/{registrationId}";
        String assertionConsumerServiceLocation = "{baseUrl}/login/saml2/sso/{registrationId}";
        Saml2X509Credential relyingPartySigningCredential = ...;

        String assertingPartyEntityId = "https://simplesaml-for-spring-saml.apps.pcfone.io/saml2/idp/metadata.php";
        String singleSignOnServiceLocation = "https://simplesaml-for-spring-saml.apps.pcfone.io/saml2/idp/SSOService.php";
        Saml2X509Credential assertingPartyVerificationCredential = ...;


        RelyingPartyRegistration rp = RelyingPartyRegistration.withRegistrationId(registrationId)
                        .entityId(relyingPartyEntityId)
                        .assertionConsumerServiceLocation(assertingConsumerServiceLocation)
                        .signingX509Credentials((c) -> c.add(relyingPartySigningCredential))
                        .assertingPartyDetails((details) -> details
                                .entityId(assertingPartyEntityId));
                                .singleSignOnServiceLocation(singleSignOnServiceLocation))
                                .verifyingX509Credentials((c) -> c.add(assertingPartyVerificationCredential))
                        .build();
 
Since:
5.2