Class AuthenticationRequirementsBuilder
java.lang.Object
se.swedenconnect.spring.saml.idp.authnrequest.AuthenticationRequirementsBuilder
A builder for
AuthenticationRequirements.- Author:
- Martin Lindström
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AuthenticationRequirementsBuilder(AuthenticationRequirements requirements) Constructor setting up a builder based on an existingAuthenticationRequirementsobject. -
Method Summary
Modifier and TypeMethodDescriptionauthnContextRequirement(String authnContextRequirement) Adds a requested authentication contexts (AuthnContextClassRef).authnContextRequirements(Collection<String> authnContextRequirements) Assigns a collection of the requested authentication contexts (AuthnContextClassRef).build()Builds theAuthenticationRequirementsobjectbuilder()Creates aAuthenticationRequirementsBuilder.builder(AuthenticationRequirements requirements) Creates aAuthenticationRequirementsBuilderbased on an existingAuthenticationRequirementsobject.entityCategories(Collection<String> entityCategories) Assigns the collection of declared SAML entity categories for the relying party.entityCategory(String entityCategory) Adds an entity category.forceAuthn(boolean forceAuthn) Tells whether "force authentication" has been set, i.e., whether to force user authentication even though a valid user session exists.passiveAuthn(boolean passiveAuthn) Tells whether we should issue an assertion without requiring the user to authenticate again.principalSelectionAttribute(UserAttribute principalSelectionAttribute) Adds a principal selection attribute.principalSelectionAttributes(Collection<UserAttribute> principalSelectionAttributes) The PrincipalSelection extension defined in Sweden Connect technical framework enables a relying party to include one or more attributes in theAuthnRequestto inform the IdP about the user that is being authenticated.requestedAttribute(RequestedAttribute requestedAttribute) Adds a requested attribute.requestedAttributes(Collection<RequestedAttribute> requestedAttributes) Assigns the attributes requested directly in the authentication request or indirectly from the relying party metadata (AttributeConsumingServiceor entity category declarations).sadRequestExtension(SadRequestExtension sadRequestExtension) Assigns theSadRequestExtensionwhich is the representation of theSADRequestextension as specified in Signature Activation Protocol for Federated Signing.signatureMessageExtension(SignatureMessageExtension signatureMessageExtension) Assigns theSignatureMessageExtensionwhich is the representation of theSignMessageextension as specified in section 3.1.2 of DSS Extension for Federated Central Signing Services.userMessageExtension(UserMessageExtension userMessageExtension) Assigns theUserMessageExtensionwhich is the representation of theUserMessageextension as specified in User Message Extension in SAML Authentication Requests.
-
Constructor Details
-
AuthenticationRequirementsBuilder
public AuthenticationRequirementsBuilder()Default constructor. -
AuthenticationRequirementsBuilder
Constructor setting up a builder based on an existingAuthenticationRequirementsobject.- Parameters:
requirements- the template object
-
-
Method Details
-
builder
Creates aAuthenticationRequirementsBuilder.- Returns:
- a builder
-
builder
Creates aAuthenticationRequirementsBuilderbased on an existingAuthenticationRequirementsobject.- Parameters:
requirements- the template object- Returns:
- a builder
-
build
Builds theAuthenticationRequirementsobject- Returns:
- an
AuthenticationRequirements
-
forceAuthn
Tells whether "force authentication" has been set, i.e., whether to force user authentication even though a valid user session exists.- Parameters:
forceAuthn-trueif authentication should be forced, andfalseotherwise- Returns:
- the builder
-
passiveAuthn
Tells whether we should issue an assertion without requiring the user to authenticate again.- Parameters:
passiveAuthn-trueif passive authentication is required, andfalseotherwise- Returns:
- the builder
-
entityCategories
Assigns the collection of declared SAML entity categories for the relying party.- Parameters:
entityCategories- a collection of URI:s representing declared entity categories- Returns:
- the builder
-
entityCategory
Adds an entity category.- Parameters:
entityCategory- an entity category URI- Returns:
- the builder
-
requestedAttributes
public AuthenticationRequirementsBuilder requestedAttributes(Collection<RequestedAttribute> requestedAttributes) Assigns the attributes requested directly in the authentication request or indirectly from the relying party metadata (AttributeConsumingServiceor entity category declarations).Note: Within the Swedish eID Framework the use of declared entity categories is the preferred way of informing the IdP about which attributes a relying party requests, see
entityCategories(Collection).- Parameters:
requestedAttributes- a collection of requested attributes- Returns:
- the builder
-
requestedAttribute
Adds a requested attribute.- Parameters:
requestedAttribute- the requested attribute- Returns:
- the builder
-
authnContextRequirements
public AuthenticationRequirementsBuilder authnContextRequirements(Collection<String> authnContextRequirements) Assigns a collection of the requested authentication contexts (AuthnContextClassRef).- Parameters:
authnContextRequirements- a collection of URI:s- Returns:
- the builder
-
authnContextRequirement
Adds a requested authentication contexts (AuthnContextClassRef).- Parameters:
authnContextRequirement- URI- Returns:
- the builder
-
principalSelectionAttributes
public AuthenticationRequirementsBuilder principalSelectionAttributes(Collection<UserAttribute> principalSelectionAttributes) The PrincipalSelection extension defined in Sweden Connect technical framework enables a relying party to include one or more attributes in theAuthnRequestto inform the IdP about the user that is being authenticated. This method assigns this information.- Parameters:
principalSelectionAttributes- a collection of "principal selection" attributes- Returns:
- the builder
-
principalSelectionAttribute
public AuthenticationRequirementsBuilder principalSelectionAttribute(UserAttribute principalSelectionAttribute) Adds a principal selection attribute.- Parameters:
principalSelectionAttribute- principal selection attribute- Returns:
- the builder
-
signatureMessageExtension
public AuthenticationRequirementsBuilder signatureMessageExtension(SignatureMessageExtension signatureMessageExtension) Assigns theSignatureMessageExtensionwhich is the representation of theSignMessageextension as specified in section 3.1.2 of DSS Extension for Federated Central Signing Services.- Parameters:
signatureMessageExtension- the sign message extension- Returns:
- the builder
-
userMessageExtension
public AuthenticationRequirementsBuilder userMessageExtension(UserMessageExtension userMessageExtension) Assigns theUserMessageExtensionwhich is the representation of theUserMessageextension as specified in User Message Extension in SAML Authentication Requests.- Parameters:
userMessageExtension- the user message extension- Returns:
- the builder
-
sadRequestExtension
public AuthenticationRequirementsBuilder sadRequestExtension(SadRequestExtension sadRequestExtension) Assigns theSadRequestExtensionwhich is the representation of theSADRequestextension as specified in Signature Activation Protocol for Federated Signing.- Parameters:
sadRequestExtension- the extension- Returns:
- the builder
-