Class AbstractAuthnRequestBuilder<BUILDER extends AbstractSAMLObjectBuilder<AuthnRequest>>

All Implemented Interfaces:
SAMLObjectBuilder<AuthnRequest>
Direct Known Subclasses:
AuthnRequestBuilder

public abstract class AbstractAuthnRequestBuilder<BUILDER extends AbstractSAMLObjectBuilder<AuthnRequest>> extends AbstractRequestBuilder<AuthnRequest, BUILDER>
Abstract builder for AuthnRequest messages.
  • Constructor Details

    • AbstractAuthnRequestBuilder

      public AbstractAuthnRequestBuilder()
  • Method Details

    • build

      public AuthnRequest build()
      Builds the AuthnRequest. If no ProtocolBinding has been assigned, it is set to HTTP-POST, unless AssertionConsumerServiceIndex has been assigned (the two attributes are mutually exclusive).
      Specified by:
      build in interface SAMLObjectBuilder<BUILDER extends AbstractSAMLObjectBuilder<AuthnRequest>>
      Overrides:
      build in class AbstractRequestBuilder<AuthnRequest, BUILDER extends AbstractSAMLObjectBuilder<AuthnRequest>>
      Returns:
      the built object
    • forceAuthn

      public BUILDER forceAuthn(Boolean b)
      Assigns the ForceAuthn attribute to the AuthnRequest object.
      Parameters:
      b - boolean flag
      Returns:
      the builder
    • isPassive

      public BUILDER isPassive(Boolean b)
      Assigns the IsPassive attribute to the AuthnRequest object.
      Parameters:
      b - boolean flag
      Returns:
      the builder
    • protocolBinding

      public BUILDER protocolBinding(String binding)
      Assigns the ProtocolBinding attribute to the AuthnRequest object.
      Parameters:
      binding - the binding URI
      Returns:
      the builder
      See Also:
    • postProtocolBinding

      public BUILDER postProtocolBinding()
      Assigns SAMLConstants.SAML2_POST_BINDING_URI to the ProtocolBinding attribute of the AuthnRequest object.

      This is the default.

      Returns:
      the builder
    • assertionConsumerServiceIndex

      public BUILDER assertionConsumerServiceIndex(Integer index)
      Assigns the AssertionConsumerServiceIndex attribute to the AuthnRequest object.
      Parameters:
      index - the index
      Returns:
      the builder
    • assertionConsumerServiceURL

      public BUILDER assertionConsumerServiceURL(String url)
      Assigns the AssertionConsumerServiceURL attribute to the AuthnRequest object.
      Parameters:
      url - the URL
      Returns:
      the builder
    • attributeConsumerServiceIndex

      public BUILDER attributeConsumerServiceIndex(Integer index)
      Assigns the AttributeConsumerServiceIndex attribute to the AuthnRequest object.
      Parameters:
      index - the index
      Returns:
      the builder
    • providerName

      public BUILDER providerName(String name)
      Assigns the ProviderName attribute to the AuthnRequest object.
      Parameters:
      name - the provider name
      Returns:
      the builder
    • subject

      public BUILDER subject(Subject subject)
      Assigns a Subject element to the AuthnRequest object.
      Parameters:
      subject - the subject (will be cloned before assignment)
      Returns:
      the builder
    • nameIDPolicy

      public BUILDER nameIDPolicy(NameIDPolicy nameIDPolicy)
      Assigns a NameIDPolicy element to the AuthnRequest object.
      Parameters:
      nameIDPolicy - the nameID policy (will be cloned before assignment)
      Returns:
      the builder
      See Also:
    • conditions

      public BUILDER conditions(Conditions conditions)
      Assigns a Conditions element to the AuthnRequest object.
      Parameters:
      conditions - the request conditions (will be cloned before assignment)
      Returns:
      the builder
    • requestedAuthnContext

      public BUILDER requestedAuthnContext(RequestedAuthnContext requestedAuthnContext)
      Assigns a RequestedAuthnContext element to the AuthnRequest object.
      Parameters:
      requestedAuthnContext - the requested authentication context (will be cloned before assignment)
      Returns:
      the builder
      See Also:
    • scoping

      public BUILDER scoping(Scoping scoping)
      Assigns a Scoping element to the AuthnRequest object.
      Parameters:
      scoping - the scoping element to add (will be cloned before assignment)
      Returns:
      the builder
    • getObjectType

      protected Class<AuthnRequest> getObjectType()
      Returns the object type.
      Specified by:
      getObjectType in class AbstractSAMLObjectBuilder<AuthnRequest>
      Returns:
      the object type