How URL evaluation works
A URL containing an{organization_name} placeholder will only be evaluated when all the following conditions are met:
- The application has the
organization_usageset toalloworrequire - A transaction was performed in the context of an organization (for example, initiating an authorization transaction with the organization parameter:
/authorize?organization=org_bVss9Do3994SIbiH&…)
{organization_name} placeholder will be evaluated in addition to exact match URLs (https://app.exampleco.com) and URLs with wildcards (https://*.exampleco.com). You must not rely on any specific order of evaluation of the URLs.
Avoid registering URLs with wildcard and Organization placeholders in the same configuration field for an application as it may lead to undesirable behavior and make troubleshooting difficult. As an example, consider an application with two Allowed Callback URLs: https://*.exampleco.com and https://{organization_name}.exampleco.com. A redirect_uri with the value of https://company-a.exampleco.com would be considered valid even if there were no Organizations with the name company-a registered in your tenant; this is due to the evaluation of the wildcard placeholder.
Wildcard URL placeholders
Wildcard placeholders in subdomains should not be used in production applications. Auth0 recommends URLs with the{organization_name} placeholder where relevant.
Manage these settings in Dashboard > Applications > Applications in the following fields:
- Allowed Callback URLs: List of URLs to which Auth0 is allowed to redirect users after they authenticate.
- Allowed Logout URLs: List of URLs to which you can redirect users after they log out from Auth0.
- Allows Web Origins: List of URLs from where an authorization request using Cross-Origin Authentication, Device Flow, and web_message as the response mode can originate.
- Allowed Origins (CORS): List of URLs that will be allowed to make requests from JavaScript to Auth0 API (typically used with CORS).
*) as a wildcard for subdomains, but it must be used in accordance with the following rules in order to properly function:
- The protocol of the URL must be
httporhttps. Protocols such ascom.example.appandservice:jmx:rmiwill not work. - The wildcard must be located in a subdomain within the hostname component.
https://*.comwill not work. - The wildcard must be located in the subdomain furthest from the root domain.
https://sub.*.example.comwill not work. - The URL must not contain more than one wildcard.
https://*.*.example.comwill not work. - A wildcard may be prefixed and/or suffixed with additional valid hostname characters.
https://prefix-*-suffix.example.comwill work. - A URL with a valid wildcard will not match a URL more than one subdomain level in place of the wildcard.
https://*.example.comwill not work withhttps://sub1.sub2.example.com.
Organization URL placeholders
You can use{organization_name} as a placeholder to dynamically specify a registered organization’s name in a URL (https://{organization_name}.exampleco.com). URLs with the {organization_name} placeholder should only be used on domains that you fully control (for example, https://{organization_name}.exampleco.com where you control the exampleco.com domain).
Manage these settings in Dashboard > Applications > Applications in the following fields:
- Allowed Callback URLs: List of URLs to which Auth0 is allowed to redirect users after they authenticate.
- Allowed Origins (CORS): List of URLs that will be allowed to make requests from JavaScript to Auth0 API (typically used with CORS).
{organization_name} placeholder:
- The protocol of the URL must be
http:orhttps:.com.example.app://{organization_name}.exampleco.comwill not work. - The placeholder must be located in a subdomain within the hostname component.
https://{organization_name}orhttps://exampleco.com/{organization_name}will both not work. - The placeholder must be located in the subdomain furthest from the root domain.
https://sub.{organization_name}.exampleco.comwill not work. - The URL must not contain more than one placeholder.
https://{organization_name}.{organization_name}.exampleco.comwill not work. - A placeholder must not be prefixed nor suffixed with additional valid hostname characters.
https://prefix-{organization_name}-suffix.exampleco.comwill not work. - A placeholder must not be used in conjunction with a wildcard in the URL.
https://{organization_name}.*.exampleco.comwill not work.
Custom domain URL placeholders
You can use{custom_domain.metadata.KEY} as a placeholder to dynamically specify a URL based on metada associated with the Custom Domain used in the request. This allows you to support multiple custom domains with different application URLs within the same tenant.
For a comprehensive overview of this feature, see Multiple Custom Domains
Validation rules
The following restrictions apply when using Custom Domain placeholders:- Public prefix required: The metadata key used in the placeholder must start with
public_orPUBLIC_(for example,{custom_domain.metadata.public_callback_subdomain}). Keys without this prefix are ignored at runtime for security reasons. - Protocol: The protocol of the URL must be
httporhttps. - Location: The placeholder must be located in the domain or subdomain component. It cannot be used in the URL path.
- Valid:
https://{custom_domain.metadata.public_app_url}.example.com/login - Invalid:
https://example.com/{custom_domain.metadata.public_path}
- Valid:
- Nesting: You cannot access nested metadata properties. Only top-level keys are supported.
- No wildcards: A custom domain placeholder must not be used in conjunction with a wildcard (
*) in the same URL. - Data type: The value in the custom domain metadata must be a String. If the key does not exist, or the value is not a String, the URL is ignored during validation.
Supported fields
These placeholders can be configured for the following Application URLs:- Allowed Callback URLs
- Allowed Logour URLs
- Allowed Web Origins
- Allowed Origins (CORS)
Custom domain placeholders are not supported for third-party applications.
Using with Organization placeholders
You can combine the Custom Domain placeholder with the{organization_name} placeholder, as long as your flow supports it. Both placeholders are evaluated and replaced at runtime.