Dynamic Callback URLs With Wildcards in Auth0
Last Updated:
Overview
Auth0 does not support dynamic callback URLs with wildcards in the URL path. Administrators must use a specific callback URL and configure the application to redirect users to dynamic endpoints. Auth0 only permits wildcards for subdomains but does not recommend them for production environments.
Applies To
- Auth0
- Callback URLs
- Wildcard URL matching
- Dynamic redirect URIs
Solution
Does Auth0 support dynamic callback URLs with wildcards in the URL path?
Auth0 does not support dynamic callback URLs that change the URL path dynamically. For example, Auth0 rejects paths formatted like the following:
https://<app_domain>.com/<something dynamic>
Auth0 only allows wildcards for subdomains. However, Auth0 does not recommend using wildcard placeholders in subdomains for production applications. Auth0 recommends using URLs with the {organization_name} placeholder where relevant. Review the documentation on Subdomain URL Placeholders for additional details.
Implement a Workaround for Dynamic Callback Routing
When the application requires dynamic values in the URL path rather than the subdomain, restructure the URL to pass the dynamic value as a query parameter instead of a path segment.
For example, use:
https://example.com/callback?app=value
Register https://example.com/callback as a static allowed callback URL. Auth0 matches on the base URL and passes the query parameter through without requiring a wildcard.