Class AbstractAuthnRequestBuilder<BUILDER extends AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.core.AuthnRequest>>

java.lang.Object
se.swedenconnect.opensaml.common.builder.AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.core.AuthnRequest>
se.swedenconnect.opensaml.saml2.core.build.AbstractRequestBuilder<org.opensaml.saml.saml2.core.AuthnRequest,BUILDER>
se.swedenconnect.opensaml.saml2.core.build.AbstractAuthnRequestBuilder<BUILDER>
All Implemented Interfaces:
SAMLObjectBuilder<org.opensaml.saml.saml2.core.AuthnRequest>
Direct Known Subclasses:
AuthnRequestBuilder

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

    • AbstractAuthnRequestBuilder

      public AbstractAuthnRequestBuilder()
  • Method Details

    • build

      public org.opensaml.saml.saml2.core.AuthnRequest build()
      The default implementation of this method assumes that the object has been built during assignment of its attributes and elements, so it simply returns the object.

      Implementations that need to perform additional processing during the build step should override this method.

      Specified by:
      build in interface SAMLObjectBuilder<BUILDER extends AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.core.AuthnRequest>>
      Overrides:
      build in class AbstractRequestBuilder<org.opensaml.saml.saml2.core.AuthnRequest,BUILDER extends AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.core.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(org.opensaml.saml.saml2.core.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(org.opensaml.saml.saml2.core.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(org.opensaml.saml.saml2.core.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(org.opensaml.saml.saml2.core.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(org.opensaml.saml.saml2.core.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<org.opensaml.saml.saml2.core.AuthnRequest> getObjectType()
      Returns the object type.
      Specified by:
      getObjectType in class AbstractSAMLObjectBuilder<org.opensaml.saml.saml2.core.AuthnRequest>
      Returns:
      the object type