Class Saml2AuthenticationRequest.Builder
- java.lang.Object
-
- org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationRequest.Builder
-
- Enclosing class:
- Saml2AuthenticationRequest
public static final class Saml2AuthenticationRequest.Builder extends java.lang.ObjectA builder forSaml2AuthenticationRequest.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Saml2AuthenticationRequest.BuilderassertionConsumerServiceUrl(java.lang.String assertionConsumerServiceUrl)Sets theassertionConsumerServiceURLfor the authentication request.Saml2AuthenticationRequestbuild()Creates aSaml2AuthenticationRequestobject.Saml2AuthenticationRequest.Buildercredentials(java.util.function.Consumer<java.util.Collection<Saml2X509Credential>> credentials)Modifies the collection ofSaml2X509Credentialcredentials used in communication between IDP and SP, specifically signing the authentication request.Saml2AuthenticationRequest.Builderdestination(java.lang.String destination)Sets the Destination for the authentication request.Saml2AuthenticationRequest.Builderissuer(java.lang.String issuer)Sets the issuer for the authentication request.
-
-
-
Method Detail
-
issuer
public Saml2AuthenticationRequest.Builder issuer(java.lang.String issuer)
Sets the issuer for the authentication request.- Parameters:
issuer- - a required value- Returns:
- this
Builder
-
credentials
public Saml2AuthenticationRequest.Builder credentials(java.util.function.Consumer<java.util.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
public Saml2AuthenticationRequest.Builder destination(java.lang.String 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(java.lang.String assertionConsumerServiceUrl)
Sets theassertionConsumerServiceURLfor the authentication request. Typically theService Provider EntityID- Parameters:
assertionConsumerServiceUrl- - a required value- Returns:
- this
Builder
-
build
public Saml2AuthenticationRequest build()
Creates aSaml2AuthenticationRequestobject.- Returns:
- the Saml2AuthenticationRequest object
- Throws:
java.lang.IllegalArgumentException- if a required property is not set
-
-