Package com.auth0
Class AuthorizeUrl
java.lang.Object
com.auth0.AuthorizeUrl
Class to create and customize an Auth0 Authorize URL.
It's not reusable.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a string representation of the URL with the configured parameters.withAudience
(String audience) Sets the audience value.withConnection
(String connection) Sets the connection value.withInvitation
(String invitation) Sets the invitation query string parameter to join an organization.Sets the nonce value.withOrganization
(String organization) Sets the organization query string parameter value used to login to an organization.withParameter
(String name, String value) Sets an additional parameter.Sets the scope value.withSecureCookie
(boolean secureCookie) Sets whether cookies used during the authentication flow have theSecure
attribute set or not.Sets the state value.
-
Method Details
-
withOrganization
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
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.
-
withConnection
Sets the connection value.- Parameters:
connection
- connection to set- Returns:
- the builder instance
-
withSecureCookie
Sets whether cookies used during the authentication flow have theSecure
attribute set or not. By default, cookies will be set with the Secure attribute if the responseType includesid_token
and thus requires theSameSite=None
cookie attribute set. Setting this to false will not override this behavior, as clients will reject cookies withSameSite=None
unless theSecure
attribute is set. While not guaranteed by all clients, generally a cookie with theSecure
attribute will be rejected unless served over HTTPS.- Parameters:
secureCookie
- whether to always set the Secure attribute on all cookies.- Returns:
- the builder instance.
-
withAudience
Sets the audience value.- Parameters:
audience
- audience to set- Returns:
- the builder instance
-
withState
Sets the state value.- Parameters:
state
- state to set- Returns:
- the builder instance
-
withNonce
Sets the nonce value.- Parameters:
nonce
- nonce to set- Returns:
- the builder instance
-
withScope
Sets the scope value.- Parameters:
scope
- scope to set- Returns:
- the builder instance
-
withParameter
Sets an additional parameter.- Parameters:
name
- name of the parametervalue
- value of the parameter to set- Returns:
- the builder instance
-
build
Creates a string representation of the URL with the configured parameters. It cannot be called more than once.- Returns:
- the string URL
- Throws:
IllegalStateException
- if it's called more than once
-