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.Builder
assertionConsumerServiceUrlTemplate(java.lang.String assertionConsumerServiceUrlTemplate)
Assertion Consumer Service URL template.RelyingPartyRegistration
build()
Constructs a RelyingPartyRegistration object based on the builder configurationsRelyingPartyRegistration.Builder
credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentials)
Modifies the collection ofSaml2X509Credential
objects used in communication between IDP and SP For example:Saml2X509Credential credential = ...; return RelyingPartyRegistration.withRegistrationId("id") .credentials(c -> c.add(credential)) ...
RelyingPartyRegistration.Builder
idpWebSsoUrl(java.lang.String url)
Deprecated.use#providerDetails(Consumer< ProviderDetails.Builder >)
RelyingPartyRegistration.Builder
localEntityIdTemplate(java.lang.String template)
Sets the local relying party, or Service Provider, entity Id template.RelyingPartyRegistration.Builder
providerDetails(java.util.function.Consumer<RelyingPartyRegistration.ProviderDetails.Builder> providerDetails)
Configures the IDP SSO endpointRelyingPartyRegistration.Builder
registrationId(java.lang.String id)
Sets theregistrationId
template.RelyingPartyRegistration.Builder
remoteIdpEntityId(java.lang.String entityId)
Deprecated.use#providerDetails(Consumer< ProviderDetails.Builder >)
-
-
-
Method Detail
-
registrationId
public RelyingPartyRegistration.Builder registrationId(java.lang.String id)
Sets theregistrationId
template. Often be used in URL paths- Parameters:
id
- registrationId for this object, should be unique- Returns:
- this object
-
remoteIdpEntityId
@Deprecated public RelyingPartyRegistration.Builder remoteIdpEntityId(java.lang.String entityId)
Deprecated.use#providerDetails(Consumer< ProviderDetails.Builder >)
Sets theentityId
for the remote asserting party, the Identity Provider.- Parameters:
entityId
- the IDP entityId- Returns:
- this object
-
assertionConsumerServiceUrlTemplate
public RelyingPartyRegistration.Builder assertionConsumerServiceUrlTemplate(java.lang.String assertionConsumerServiceUrlTemplate)
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
-
idpWebSsoUrl
@Deprecated public RelyingPartyRegistration.Builder idpWebSsoUrl(java.lang.String url)
Deprecated.use#providerDetails(Consumer< ProviderDetails.Builder >)
Sets theSSO URL
for the remote asserting party, the Identity Provider.- Parameters:
url
- - a URL that accepts authentication requests via REDIRECT or POST bindings- Returns:
- this object
-
providerDetails
public RelyingPartyRegistration.Builder providerDetails(java.util.function.Consumer<RelyingPartyRegistration.ProviderDetails.Builder> providerDetails)
Configures the IDP SSO endpoint- Parameters:
providerDetails
- a consumer that configures the IDP SSO endpoint- Returns:
- this object
-
credentials
public RelyingPartyRegistration.Builder credentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentials)
Modifies the collection ofSaml2X509Credential
objects 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
-
localEntityIdTemplate
public RelyingPartyRegistration.Builder localEntityIdTemplate(java.lang.String template)
Sets 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}
- Returns:
- a string containing the entity ID or entity ID template
-
build
public RelyingPartyRegistration build()
Constructs a RelyingPartyRegistration object based on the builder configurations- Returns:
- a RelyingPartyRegistration instance
-
-