Class AuthenticationRequirementsBuilder
java.lang.Object
se.swedenconnect.spring.saml.idp.authnrequest.AuthenticationRequirementsBuilder
A builder for
AuthenticationRequirements
.- Author:
- Martin Lindström
-
Constructor Summary
ConstructorDescriptionDefault constructor.AuthenticationRequirementsBuilder
(AuthenticationRequirements requirements) Constructor setting up a builder based on an existingAuthenticationRequirements
object. -
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 theAuthenticationRequirements
objectbuilder()
Creates aAuthenticationRequirementsBuilder
.builder
(AuthenticationRequirements requirements) Creates aAuthenticationRequirementsBuilder
based on an existingAuthenticationRequirements
object.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 theAuthnRequest
to 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 (AttributeConsumingService
or entity category declarations).sadRequestExtension
(SadRequestExtension sadRequestExtension) Assigns theSadRequestExtension
which is the representation of theSADRequest
extension as specified in Signature Activation Protocol for Federated Signing.signatureMessageExtension
(SignatureMessageExtension signatureMessageExtension) Assigns theSignatureMessageExtension
which is the representation of theSignMessage
extension as specified in section 3.1.2 of DSS Extension for Federated Central Signing Services.userMessageExtension
(UserMessageExtension userMessageExtension) Assigns theUserMessageExtension
which is the representation of theUserMessage
extension 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 existingAuthenticationRequirements
object.- Parameters:
requirements
- the template object
-
-
Method Details
-
builder
Creates aAuthenticationRequirementsBuilder
.- Returns:
- a builder
-
builder
Creates aAuthenticationRequirementsBuilder
based on an existingAuthenticationRequirements
object.- Parameters:
requirements
- the template object- Returns:
- a builder
-
build
Builds theAuthenticationRequirements
object- 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
-true
if authentication should be forced, andfalse
otherwise- Returns:
- the builder
-
passiveAuthn
Tells whether we should issue an assertion without requiring the user to authenticate again.- Parameters:
passiveAuthn
-true
if passive authentication is required, andfalse
otherwise- 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 (AttributeConsumingService
or 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 theAuthnRequest
to 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 theSignatureMessageExtension
which is the representation of theSignMessage
extension 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 theUserMessageExtension
which is the representation of theUserMessage
extension 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 theSadRequestExtension
which is the representation of theSADRequest
extension as specified in Signature Activation Protocol for Federated Signing.- Parameters:
sadRequestExtension
- the extension- Returns:
- the builder
-