Class AuthorizeUrlBuilder

java.lang.Object
com.auth0.client.auth.AuthorizeUrlBuilder

public class AuthorizeUrlBuilder extends Object
Class that provides the methods to generate a valid Auth0 Authorize Url. It's based on the https://auth0.com/docs/api/authentication#social docs.

This class is not thread-safe: It makes use of HashMap for storing the parameters. Make sure to not call the builder methods from a different or un-synchronized thread.

  • Method Details

    • withConnection

      public AuthorizeUrlBuilder withConnection(String connection)
      Sets the connection value.
      Parameters:
      connection - connection to set
      Returns:
      the builder instance
    • withAudience

      public AuthorizeUrlBuilder withAudience(String audience)
      Sets the audience value.
      Parameters:
      audience - audience to set
      Returns:
      the builder instance
    • withState

      public AuthorizeUrlBuilder withState(String state)
      Sets the state value.
      Parameters:
      state - state to set
      Returns:
      the builder instance
    • withScope

      public AuthorizeUrlBuilder withScope(String scope)
      Sets the scope value.
      Parameters:
      scope - scope to set
      Returns:
      the builder instance
    • withResponseType

      public AuthorizeUrlBuilder withResponseType(String responseType)
      Sets the response type value.
      Parameters:
      responseType - response type to set
      Returns:
      the builder instance
    • withOrganization

      public AuthorizeUrlBuilder 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 AuthorizeUrlBuilder 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.
    • withParameter

      public AuthorizeUrlBuilder withParameter(String name, String value)
      Sets an additional parameter.
      Parameters:
      name - name of the parameter
      value - value of the parameter to set
      Returns:
      the builder instance
    • withCodeChallenge

      public AuthorizeUrlBuilder withCodeChallenge(String challenge)
      Sets the code_challenge parameter used when using the Authorization Code Flow with Proof of Code Exchange (PKCE).
      Parameters:
      challenge - the generated challenge from a code_verifier
      Returns:
      the builder instance.
      See Also:
    • build

      public String build()
      Creates a string representation of the URL with the configured parameters.
      Returns:
      the string URL