A module representing custom domains on Auth0.
A custom domain serves login from auth.yourapp.com rather than
your-tenant.auth0.com, so users never see the tenant URL.
Setting one up is a sequence, and the order matters:
create/1registers the domain and returns the DNS record to add- add that record with your DNS provider
verify/1tells Auth0 to check for it — the domain stays inpending_verificationuntil this succeedsset_default/1promotes it, once verified
Summary
Functions
Gets all custom domains.
Registers a custom domain.
Gets the tenant's default custom domain — the one users are sent to
Deletes a custom domain.
Gets a custom domain by id
Promotes a verified custom domain to be the tenant's default.
Tests a custom domain's configuration
Updates a custom domain.
Asks Auth0 to check the DNS record and verify the domain.
Functions
Gets all custom domains.
Supports checkpoint pagination (from / take), q and sort.
iex> Auth0Client.Management.CustomDomain.all()
iex> Auth0Client.Management.CustomDomain.all(take: 10)
Registers a custom domain.
domain and type are required. type is "auth0_managed_certs" — Auth0
provisions and renews the certificate — or "self_managed_certs", where you
terminate TLS yourself.
The response carries the verification record you must add to DNS. The domain
does nothing until verify/1 confirms it.
iex> Auth0Client.Management.CustomDomain.create(%{domain: "auth.example.com", type: "auth0_managed_certs"})
Gets the tenant's default custom domain — the one users are sent to
iex> Auth0Client.Management.CustomDomain.default()
Deletes a custom domain.
Logins fall back to the tenant domain, so anything hard-coded against the custom one breaks.
iex> Auth0Client.Management.CustomDomain.delete("cd_abc123")
Gets a custom domain by id
iex> Auth0Client.Management.CustomDomain.get("cd_abc123")
Promotes a verified custom domain to be the tenant's default.
Takes the domain name, not the id that every other function here takes — that asymmetry is Auth0's.
iex> Auth0Client.Management.CustomDomain.set_default("auth.example.com")
Tests a custom domain's configuration
iex> Auth0Client.Management.CustomDomain.test("cd_abc123")
Updates a custom domain.
Only tls_policy, custom_client_ip_header, domain_metadata and
relying_party_identifier can change. domain and type are fixed at creation
— to change either, delete the domain and register it again.
iex> Auth0Client.Management.CustomDomain.update("cd_abc123", %{tls_policy: "recommended"})
Asks Auth0 to check the DNS record and verify the domain.
Call it after adding the record from create/1. Verification can take a few
minutes to propagate; the response reports the current status.
iex> Auth0Client.Management.CustomDomain.verify("cd_abc123")