Class RelyingPartyRegistration.Builder
- java.lang.Object
-
- org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration.Builder
-
- Enclosing class:
- RelyingPartyRegistration
public static final class RelyingPartyRegistration.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RelyingPartyRegistration.BuilderassertingPartyDetails(java.util.function.Consumer<RelyingPartyRegistration.AssertingPartyDetails.Builder> assertingPartyDetails)Apply thisConsumerto further configure the Asserting Party detailsRelyingPartyRegistration.BuilderassertionConsumerServiceBinding(Saml2MessageBinding assertionConsumerServiceBinding)Set the AssertionConsumerService Binding.RelyingPartyRegistration.BuilderassertionConsumerServiceLocation(java.lang.String assertionConsumerServiceLocation)Set the AssertionConsumerService Location.RelyingPartyRegistration.BuilderassertionConsumerServiceUrlTemplate(java.lang.String assertionConsumerServiceUrlTemplate)Deprecated.UseassertionConsumerServiceLocationinstead.RelyingPartyRegistrationbuild()Constructs a RelyingPartyRegistration object based on the builder configurationsRelyingPartyRegistration.Buildercredentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentials)Deprecated.UsesigningX509CredentialsordecryptionX509Credentialsinstead for relying party keys orRelyingPartyRegistration.AssertingPartyDetails.Builder.verificationX509CredentialsorRelyingPartyRegistration.AssertingPartyDetails.Builder.encryptionX509Credentialsfor asserting party keysRelyingPartyRegistration.BuilderdecryptionX509Credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentialsConsumer)Apply thisConsumerto theCollectionofSaml2X509Credentials for the purposes of modifying theCollectionRelyingPartyRegistration.BuilderentityId(java.lang.String entityId)Set the relying party's EntityID.RelyingPartyRegistration.BuilderidpWebSsoUrl(java.lang.String url)Deprecated.use#assertingPartyDetails(Consumer<AssertingPartyDetails.Builder >)RelyingPartyRegistration.BuilderlocalEntityIdTemplate(java.lang.String template)Deprecated.UseentityIdinsteadRelyingPartyRegistration.BuildernameIdFormat(java.lang.String nameIdFormat)Set the NameID formatRelyingPartyRegistration.BuilderproviderDetails(java.util.function.Consumer<RelyingPartyRegistration.ProviderDetails.Builder> providerDetails)RelyingPartyRegistration.BuilderregistrationId(java.lang.String id)Sets theregistrationIdtemplate.RelyingPartyRegistration.BuilderremoteIdpEntityId(java.lang.String entityId)Deprecated.use#assertingPartyDetails(Consumer<AssertingPartyDetails.Builder >)RelyingPartyRegistration.BuildersigningX509Credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentialsConsumer)Apply thisConsumerto theCollectionofSaml2X509Credentials for the purposes of modifying theCollectionRelyingPartyRegistration.BuildersingleLogoutServiceBinding(Saml2MessageBinding singleLogoutServiceBinding)Set the SingleLogoutService BindingRelyingPartyRegistration.BuildersingleLogoutServiceBindings(java.util.function.Consumer<java.util.Collection<Saml2MessageBinding>> bindingsConsumer)Apply thisConsumerto theCollectionofSaml2MessageBindings for the purposes of modifying the SingleLogoutService BindingCollection.RelyingPartyRegistration.BuildersingleLogoutServiceLocation(java.lang.String singleLogoutServiceLocation)Set the SingleLogoutService LocationRelyingPartyRegistration.BuildersingleLogoutServiceResponseLocation(java.lang.String singleLogoutServiceResponseLocation)
-
-
-
Method Detail
-
registrationId
public RelyingPartyRegistration.Builder registrationId(java.lang.String id)
Sets theregistrationIdtemplate. Often be used in URL paths- Parameters:
id- registrationId for this object, should be unique- Returns:
- this object
-
entityId
public RelyingPartyRegistration.Builder entityId(java.lang.String entityId)
Set the relying party's EntityID. Equivalent to the value found in the relying party's <EntityDescriptor EntityID="..."/> This value may contain a number of placeholders. They arebaseUrl,registrationId,baseScheme,baseHost, andbasePort.- Parameters:
entityId- the relying party's EntityID- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
signingX509Credentials
public RelyingPartyRegistration.Builder signingX509Credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentialsConsumer)
Apply thisConsumerto theCollectionofSaml2X509Credentials for the purposes of modifying theCollection- Parameters:
credentialsConsumer- - theConsumerfor modifying theCollection- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
decryptionX509Credentials
public RelyingPartyRegistration.Builder decryptionX509Credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentialsConsumer)
Apply thisConsumerto theCollectionofSaml2X509Credentials for the purposes of modifying theCollection- Parameters:
credentialsConsumer- - theConsumerfor modifying theCollection- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
assertionConsumerServiceLocation
public RelyingPartyRegistration.Builder assertionConsumerServiceLocation(java.lang.String assertionConsumerServiceLocation)
Set the AssertionConsumerService Location.Equivalent to the value found in <AssertionConsumerService Location="..."/> in the relying party's <SPSSODescriptor>
This value may contain a number of placeholders. They are
baseUrl,registrationId,baseScheme,baseHost, andbasePort.- Parameters:
assertionConsumerServiceLocation- the AssertionConsumerService location- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
assertionConsumerServiceBinding
public RelyingPartyRegistration.Builder assertionConsumerServiceBinding(Saml2MessageBinding assertionConsumerServiceBinding)
Set the AssertionConsumerService Binding.Equivalent to the value found in <AssertionConsumerService Binding="..."/> in the relying party's <SPSSODescriptor>
- Parameters:
assertionConsumerServiceBinding- the AssertionConsumerService binding- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
singleLogoutServiceBinding
public RelyingPartyRegistration.Builder singleLogoutServiceBinding(Saml2MessageBinding singleLogoutServiceBinding)
Set the SingleLogoutService BindingEquivalent to the value found in <SingleLogoutService Binding="..."/> in the relying party's <SPSSODescriptor>.
- Parameters:
singleLogoutServiceBinding- the SingleLogoutService Binding- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.6
-
singleLogoutServiceBindings
public RelyingPartyRegistration.Builder singleLogoutServiceBindings(java.util.function.Consumer<java.util.Collection<Saml2MessageBinding>> bindingsConsumer)
Apply thisConsumerto theCollectionofSaml2MessageBindings for the purposes of modifying the SingleLogoutService BindingCollection.Equivalent to the value found in <SingleLogoutService Binding="..."/> in the relying party's <SPSSODescriptor>.
- Parameters:
bindingsConsumer- - theConsumerfor modifying theCollection- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.8
-
singleLogoutServiceLocation
public RelyingPartyRegistration.Builder singleLogoutServiceLocation(java.lang.String singleLogoutServiceLocation)
Set the SingleLogoutService LocationEquivalent to the value found in <SingleLogoutService Location="..."/> in the relying party's <SPSSODescriptor>.
- Parameters:
singleLogoutServiceLocation- the SingleLogoutService Location- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.6
-
singleLogoutServiceResponseLocation
public RelyingPartyRegistration.Builder singleLogoutServiceResponseLocation(java.lang.String singleLogoutServiceResponseLocation)
Set the SingleLogoutService Response LocationEquivalent to the value found in <SingleLogoutService ResponseLocation="..."/> in the relying party's <SPSSODescriptor>.
- Parameters:
singleLogoutServiceResponseLocation- the SingleLogoutService Response Location- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.6
-
nameIdFormat
public RelyingPartyRegistration.Builder nameIdFormat(java.lang.String nameIdFormat)
Set the NameID format- Parameters:
nameIdFormat-- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.7
-
assertingPartyDetails
public RelyingPartyRegistration.Builder assertingPartyDetails(java.util.function.Consumer<RelyingPartyRegistration.AssertingPartyDetails.Builder> assertingPartyDetails)
Apply thisConsumerto further configure the Asserting Party details- Parameters:
assertingPartyDetails- TheConsumerto apply- Returns:
- the
RelyingPartyRegistration.Builderfor further configuration - Since:
- 5.4
-
credentials
@Deprecated public RelyingPartyRegistration.Builder credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentials)
Deprecated.UsesigningX509CredentialsordecryptionX509Credentialsinstead for relying party keys orRelyingPartyRegistration.AssertingPartyDetails.Builder.verificationX509CredentialsorRelyingPartyRegistration.AssertingPartyDetails.Builder.encryptionX509Credentialsfor asserting party keysModifies the collection ofSaml2X509Credentialobjects used in communication between IDP and SP For example:Saml2X509Credential credential = ...; return RelyingPartyRegistration.withRegistrationId("id") .credentials((c) -> c.add(credential)) ... .build();- Parameters:
credentials- - a consumer that can modify the collection of credentials- Returns:
- this object
-
assertionConsumerServiceUrlTemplate
@Deprecated public RelyingPartyRegistration.Builder assertionConsumerServiceUrlTemplate(java.lang.String assertionConsumerServiceUrlTemplate)
Deprecated.UseassertionConsumerServiceLocationinstead.Assertion Consumer Service URL template. It can contain variablesbaseUrl,registrationId,baseScheme,baseHost, andbasePort.- Parameters:
assertionConsumerServiceUrlTemplate- the Assertion Consumer Service URL template (i.e. "{baseUrl}/login/saml2/sso/{registrationId}".- Returns:
- this object
-
remoteIdpEntityId
@Deprecated public RelyingPartyRegistration.Builder remoteIdpEntityId(java.lang.String entityId)
Deprecated.use#assertingPartyDetails(Consumer<AssertingPartyDetails.Builder >)Sets theentityIdfor the remote asserting party, the Identity Provider.- Parameters:
entityId- the IDP entityId- Returns:
- this object
-
idpWebSsoUrl
@Deprecated public RelyingPartyRegistration.Builder idpWebSsoUrl(java.lang.String url)
Deprecated.use#assertingPartyDetails(Consumer<AssertingPartyDetails.Builder >)Sets theSSO URLfor the remote asserting party, the Identity Provider.- Parameters:
url- - a URL that accepts authentication requests via REDIRECT or POST bindings- Returns:
- this object
-
localEntityIdTemplate
@Deprecated public RelyingPartyRegistration.Builder localEntityIdTemplate(java.lang.String template)
Deprecated.UseentityIdinsteadSets the local relying party, or Service Provider, entity Id template. can generate it's entity ID based on possible variables ofbaseUrl,registrationId,baseScheme,baseHost, andbasePort, for example{baseUrl}/saml2/service-provider-metadata/{registrationId}- Parameters:
template- the entity id- Returns:
- a string containing the entity ID or entity ID template
-
providerDetails
@Deprecated public RelyingPartyRegistration.Builder providerDetails(java.util.function.Consumer<RelyingPartyRegistration.ProviderDetails.Builder> providerDetails)
Deprecated.Configures the IDP SSO endpoint- Parameters:
providerDetails- a consumer that configures the IDP SSO endpoint- Returns:
- this object
-
build
public RelyingPartyRegistration build()
Constructs a RelyingPartyRegistration object based on the builder configurations- Returns:
- a RelyingPartyRegistration instance
-
-