Package com.auth0

Class AuthenticationController.Builder

java.lang.Object
com.auth0.AuthenticationController.Builder
Enclosing class:
AuthenticationController

public static class AuthenticationController.Builder extends Object
  • Method Details

    • withHttpOptions

      public AuthenticationController.Builder withHttpOptions(com.auth0.client.HttpOptions httpOptions)
      Customize certain aspects of the underlying HTTP client networking library, such as timeouts and proxy configuration.
      Parameters:
      httpOptions - a non-null HttpOptions
      Returns:
      this same builder instance.
    • withResponseType

      public AuthenticationController.Builder withResponseType(String responseType)
      Change the response type to request in the Authorization step. Default value is 'code'.
      Parameters:
      responseType - the response type to request. Any combination of 'code', 'token' and 'id_token' but 'token id_token' is allowed, using a space as separator.
      Returns:
      this same builder instance.
    • withJwkProvider

      public AuthenticationController.Builder withJwkProvider(com.auth0.jwk.JwkProvider jwkProvider)
      Sets the Jwk Provider that will return the Public Key required to verify the token in case of Implicit Grant flows. This is required if the Auth0 Application is signing the tokens with the RS256 algorithm.
      Parameters:
      jwkProvider - a valid Jwk provider.
      Returns:
      this same builder instance.
    • withClockSkew

      public AuthenticationController.Builder withClockSkew(Integer clockSkew)
      Sets the clock-skew or leeway value to use in the ID Token verification. The value must be in seconds. Defaults to 60 seconds.
      Parameters:
      clockSkew - the clock-skew to use for ID Token verification, in seconds.
      Returns:
      this same builder instance.
    • withAuthenticationMaxAge

      public AuthenticationController.Builder withAuthenticationMaxAge(Integer maxAge)
      Sets the allowable elapsed time in seconds since the last time user was authenticated. By default there is no limit.
      Parameters:
      maxAge - the max age of the authentication, in seconds.
      Returns:
      this same builder instance.
    • withLegacySameSiteCookie

      public AuthenticationController.Builder withLegacySameSiteCookie(boolean useLegacySameSiteCookie)
      Sets whether fallback cookies will be set for clients that do not support SameSite=None cookie attribute. The SameSite Cookie attribute will only be set to "None" if the reponseType includes "id_token". By default this is true.
      Parameters:
      useLegacySameSiteCookie - whether fallback auth-based cookies should be set.
      Returns:
      this same builder instance.
    • withOrganization

      public AuthenticationController.Builder withOrganization(String organization)
      Sets the organization query string parameter value used to login to an organization.
      Parameters:
      organization - The ID of the organization to log the user in to.
      Returns:
      the builder instance.
    • withInvitation

      public AuthenticationController.Builder withInvitation(String invitation)
      Sets the invitation query string parameter to join an organization. If using this, you must also specify the organization using withOrganization(String).
      Parameters:
      invitation - The ID of the invitation to accept. This is available on the URL that is provided when accepting an invitation.
      Returns:
      the builder instance.
    • build

      Create a new AuthenticationController instance that will handle both Code Grant and Implicit Grant flows using either Code Exchange or Token Signature verification.
      Returns:
      a new instance of AuthenticationController.
      Throws:
      UnsupportedOperationException - if the Implicit Grant is chosen and the environment doesn't support UTF-8 encoding.