DEV Community

Carla Urrea Stabile for Auth0 for Developers

Posted on Edited on

How to Set Up an Auth0 Custom Domain?

Replace your-tenant.your-region.auth0.com with your own branded login domain! In this tutorial, learn how to configure a custom domain in Auth0 using Namecheap and verify propagation using the terminal.

We will also cover mandatory setup requirements—like credit card authorization—and show you how to update your application environment variables (featuring a Ruby on Rails example).

What You'll Learn:

  • Key prerequisites for Auth0 custom domains (Billing setup & session implications)
  • Setting up CNAME records in Namecheap
  • Verifying DNS propagation directly from your terminal using dig
  • Updating app configuration to route authentication traffic through your custom URL

Resources & Links:

Top comments (1)

Collapse
 
baumgaerben profile image
baumgaerben •

Custom domain trên Auth0 nghe đơn giản nhưng có mấy chỗ dễ dính lỗi khi triển khai production. Đã từng gặp case CNAME trỏ đúng mà vẫn fail vì quên verify ownership qua TXT record — Auth0 bắt buộc step này trước khi cấp SSL cert.

Một điểm hay bị bỏ qua: cookie domain setting. Nếu app chạy trên App mà custom domain là Auth, cần set cookieDomain: '.Example' trong config SDK để session share được cross-subdomain. Không thì user login xong redirect về app vẫn bị logout ngay.

Còn về SSL: Auth0 dùng Let's Encrypt tự động renew, nhưng nếu dùng Cloudflare proxy (orange cloud) thì phải tắt proxy cho record CNAME trỏ về Auth0, không thì cert validation fail do Cloudflare chặn challenge request. Learned that the hard way khi staging lên prod.

Ai đang setup nhớ test flow passwordless + social login riêng, vì custom domain ảnh hưởng redirect URI — một số provider (Google, GitHub) validate domain khớp với OAuth config, mismatch thì bị block (site: labagent .tech)