Skip to content
Back to Authdog Blog

Get a custom identity domain working

CNAME the identity hostname to the regional edge and leave the record DNS-only. A proxied CNAME hides the edge and HTTPS returns 525.

Authdog Team

3 min read
Centered Authdog mark with angled CNAME word plate on a grainy sky wash

Hosted sign-in can live on your hostname, such as id.example.com, instead of an Authdog host. The hostname has to resolve to the regional vanity edge. A proxied CNAME does not get there.

Verify the apex

In the console, open tenant Settings > Domains. Add the apex, example.com, and publish the TXT record the page shows at the host it names. Wait until the row is Verified.

Set the identity hostname

On the environment, open Domains. Set Identity Flows URI to the hostname only:

id.example.com

No https://, no path, no port. Saving the field adds a vanity row for that host.

CNAME to the edge

Create one DNS record. The target is the regional edge hostname the console shows. For the NBG1 edge that is nbg1-dns.authdog.com.

Field Value
Type CNAME
Name id
Target nbg1-dns.authdog.com
Proxy DNS only (grey cloud)

The target is a hostname. https://nbg1-dns.authdog.com/ is not a DNS target.

The CNAME has to stay unproxied. On Cloudflare the orange cloud is a proxy, and that proxy is what keeps the hostname from working. Cloudflare answers the name itself. dig id.example.com returns Cloudflare addresses, such as 104.21.56.125 and 172.67.151.43, and no CNAME. Browsers open TLS to Cloudflare, not to the vanity edge.

The edge issues a certificate for the hostname the client asked for, and it can do that only when the client connects to the edge. While the proxy is in front and that certificate does not exist yet, HTTPS fails at Cloudflare with 525 (the proxy could not finish a TLS handshake with the origin).

Turn the proxy off and save the record again.

dig should then show the CNAME and the edge address behind it:

id.example.com.           CNAME  nbg1-dns.authdog.com.
nbg1-dns.authdog.com.     A      <edge address>

A resolver that cached the proxied answer keeps printing the Cloudflare addresses until that TTL runs out. Wait for the TTL, or query a resolver that does not have the old record. The authoritative answer is the CNAME.

Sync the domain

Back in Verified Domains, choose Sync Domain. The row should reach Synchronized.

Open https://id.example.com/. The first request lets the edge finish a certificate for that exact name. A working host returns 200, and the certificate subject is id.example.com.

If Sync reports that the domain is not pointing at the edge, the CNAME target is wrong, the record is still proxied, or public DNS has not caught up. Fix the record and sync again.

Hosted sign-in is https://id.example.com/signin/<environmentId>. The session cookie is set for the apex (.example.com), so an app on app.example.com can read it. A redirect back to that app does not put ?token= on the URL.

The field list and the other failure cases are in Custom domains.

Check

dig id.example.com CNAME +short
dig id.example.com A +short
curl -fsSI https://id.example.com/

dig prints nbg1-dns.authdog.com. and the edge address, not a Cloudflare anycast address. curl prints HTTP/2 200.