Class Saml2AuthenticationRequest.Builder
java.lang.Object
org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequest.Builder
- Enclosing class:
- Saml2AuthenticationRequest
A builder for
Saml2AuthenticationRequest.-
Method Summary
Modifier and TypeMethodDescriptionassertionConsumerServiceUrl(String assertionConsumerServiceUrl) Sets theassertionConsumerServiceURLfor the authentication request.build()Creates aSaml2AuthenticationRequestobject.credentials(Consumer<Collection<Saml2X509Credential>> credentials) Modifies the collection ofSaml2X509Credentialcredentials used in communication between IDP and SP, specifically signing the authentication request.destination(String destination) Sets the Destination for the authentication request.Sets the issuer for the authentication request.
-
Method Details
-
issuer
Sets the issuer for the authentication request.- Parameters:
issuer- - a required value- Returns:
- this
Builder
-
credentials
public Saml2AuthenticationRequest.Builder credentials(Consumer<Collection<Saml2X509Credential>> credentials) Modifies the collection ofSaml2X509Credentialcredentials used in communication between IDP and SP, specifically signing the authentication request. For example:Saml2X509Credential credential = ...; return Saml2AuthenticationRequest.withLocalSpEntityId("id") .credentials((c) -> c.add(credential)) ... .build();- Parameters:
credentials- - a consumer that can modify the collection of credentials- Returns:
- this object
-
destination
Sets the Destination for the authentication request. Typically theService Provider EntityID- Parameters:
destination- - a required value- Returns:
- this
Builder
-
assertionConsumerServiceUrl
public Saml2AuthenticationRequest.Builder assertionConsumerServiceUrl(String assertionConsumerServiceUrl) Sets theassertionConsumerServiceURLfor the authentication request. Typically theService Provider EntityID- Parameters:
assertionConsumerServiceUrl- - a required value- Returns:
- this
Builder
-
build
Creates aSaml2AuthenticationRequestobject.- Returns:
- the Saml2AuthenticationRequest object
- Throws:
IllegalArgumentException- if a required property is not set
-