Skip to Content

Custom Domains API

Custom Domains allow you to serve Auris hosted login pages and OAuth flows under your own branded domain (e.g., auth.yourdomain.com) instead of the default Auris domain. This provides a seamless, white-label experience where your users never see the Auris brand.

The custom domain lifecycle follows these steps:

  1. Add the domain via the API
  2. Configure DNS — add the CNAME or TXT record Auris provides
  3. Verify — Auris checks the DNS record and provisions an SSL certificate
  4. Activate — set the domain as the primary domain for your tenant

Once active, all OAuth redirects, hosted login pages, email links, and SDK configurations use your custom domain.

All endpoints require the x-tenant header and a valid Bearer token. Custom domain management requires admin-level access.

List Custom Domains

GET/api/custom-domainsRequires: admin:all

List all custom domains configured for the tenant, including their verification and SSL status. Returns domains in creation order.

Success response

{ "ok": true, "data": [ { "id": "cd_abc123", "domain": "auth.acme-corp.com", "status": "ACTIVE", "sslStatus": "ACTIVE", "verificationMethod": "CNAME", "verificationToken": "auris-verify-abc123def456", "primaryDomain": true, "createdAt": "2025-01-15T10:00:00Z", "verifiedAt": "2025-01-15T10:45:00Z" }, { "id": "cd_def456", "domain": "login.acme.io", "status": "PENDING", "sslStatus": "PENDING", "verificationMethod": "TXT", "verificationToken": "auris-verify-ghi789jkl012", "primaryDomain": false, "createdAt": "2025-02-10T08:00:00Z", "verifiedAt": null } ] }

Domain Status Lifecycle

StatusDescription
PENDINGDomain added, DNS verification not yet attempted
VERIFYINGVerification check is in progress
ACTIVEDomain verified, SSL certificate provisioned, ready for use
FAILEDDNS verification failed — the expected record was not found
DELETEDDomain has been soft-deleted

SSL Status

SSL StatusDescription
PENDINGSSL certificate has not yet been provisioned (waiting for domain verification)
ACTIVESSL certificate is active and valid
EXPIREDSSL certificate has expired and needs renewal

SSL certificates are provisioned automatically after successful domain verification. Auris handles certificate issuance and renewal — no manual certificate management is required.

Add a Custom Domain

POST/api/custom-domainsRequires: admin:all

Add a new custom domain to the tenant. Auris generates a unique verification token and returns the DNS record that must be created to prove domain ownership.

Request body

{ "domain": "auth.acme-corp.com" }
FieldRequiredDescription
domainYesThe fully qualified domain name. Must be a valid domain or subdomain.

Success response

{ "ok": true, "data": { "id": "cd_ghi789", "domain": "auth.acme-corp.com", "status": "PENDING", "sslStatus": "PENDING", "verificationMethod": "CNAME", "verificationToken": "auris-verify-mno345pqr678", "primaryDomain": false, "dnsRecord": { "type": "CNAME", "host": "auth.acme-corp.com", "value": "your-auris-domain.com" }, "createdAt": "2025-02-18T10:00:00Z" } }

After creating the domain, add the DNS record shown in dnsRecord at your domain registrar. The record type depends on the domain configuration:

CNAME verification (for subdomains like auth.acme-corp.com):

CNAME auth.acme-corp.com → your-auris-domain.com

TXT verification (alternative method):

TXT _auris-verify.auth.acme-corp.com → auris-verify-mno345pqr678

Once the DNS record is propagated, call the verify endpoint.

Error codes

CodeHTTPDescription
DOMAIN_TAKEN409This domain is already registered to another tenant
DOMAIN_EXISTS409This domain is already added to this tenant
VALIDATION_ERROR400Invalid domain format (e.g., bare IP address, localhost)
APEX_DOMAIN_NOT_SUPPORTED400Apex domains (e.g., acme-corp.com without a subdomain) are not supported for CNAME verification. Use a subdomain like auth.acme-corp.com.

Apex (root) domains cannot use CNAME records without conflicting with other DNS records. It is strongly recommended to use a subdomain like auth.yourdomain.com, login.yourdomain.com, or id.yourdomain.com.

Verify a Domain

POST/api/custom-domains/[id]/verifyRequires: admin:all

Trigger DNS verification for the domain. Auris performs a live DNS lookup to check for the CNAME or TXT record. On successful verification, SSL certificate provisioning begins automatically.

Request: No body required.

Success response — verified

{ "ok": true, "data": { "id": "cd_ghi789", "domain": "auth.acme-corp.com", "status": "ACTIVE", "sslStatus": "PENDING", "verifiedAt": "2025-02-18T10:45:00Z" } }

After verification succeeds, the SSL status transitions from PENDING to ACTIVE within a few minutes as the certificate is provisioned.

Success response — not yet propagated

{ "ok": true, "data": { "id": "cd_ghi789", "domain": "auth.acme-corp.com", "status": "PENDING", "message": "DNS record not found yet. DNS propagation can take up to 48 hours." } }

Success response — verification failed

{ "ok": true, "data": { "id": "cd_ghi789", "domain": "auth.acme-corp.com", "status": "FAILED", "message": "CNAME record found but points to an incorrect target. Expected: your-auris-domain.com, Found: other-service.com" } }

Error codes

CodeHTTPDescription
DOMAIN_NOT_FOUND404Custom domain ID does not exist
ALREADY_VERIFIED400Domain is already verified and active

DNS propagation typically completes within minutes but can take up to 48 hours. A FAILED status is not permanent — correct the DNS record and call verify again. You can call the verify endpoint as many times as needed.

Delete a Custom Domain

DELETE/api/custom-domains/[id]Requires: admin:all

Delete a custom domain. The SSL certificate is deprovisioned and the domain can no longer be used for Auris services. If the deleted domain was the primary domain, the tenant reverts to the default Auris domain.

Success response

{ "ok": true, "data": { "deleted": true } }

Error codes

CodeHTTPDescription
DOMAIN_NOT_FOUND404Custom domain ID does not exist

Deleting the primary custom domain immediately affects all OAuth flows, hosted login pages, email links, and SDK configurations that reference it. Users will be redirected to the default Auris domain. Update your application’s SDK configuration and redirect URIs before deleting a primary domain.

Set Primary Domain

PATCH/api/custom-domains/[id]Requires: admin:all

Update a custom domain’s settings. Currently, the only supported update is setting or unsetting the domain as the primary domain.

Setting a domain as primary causes all Auris-generated URLs (OAuth redirect base, email links, OIDC discovery issuer) to use this domain instead of the default Auris domain.

Request body

{ "primaryDomain": true }
FieldRequiredDescription
primaryDomainYesSet to true to make this the primary domain. Setting to false reverts the tenant to the default Auris domain. Only one domain can be primary at a time — setting a new primary automatically unsets the previous one.

Success response

{ "ok": true, "data": { "id": "cd_abc123", "domain": "auth.acme-corp.com", "primaryDomain": true, "updatedAt": "2025-02-18T12:00:00Z" } }

Error codes

CodeHTTPDescription
DOMAIN_NOT_VERIFIED400Cannot set as primary — domain is not yet verified (status must be ACTIVE)
SSL_NOT_ACTIVE400Cannot set as primary — SSL certificate is not yet provisioned
DOMAIN_NOT_FOUND404Custom domain ID does not exist

How Custom Domains Work

When a custom domain is set as primary, the following Auris behaviors change:

FeatureBeforeAfter
Hosted login page URLyour-auris-domain.com/hosted/loginauth.yourdomain.com/hosted/login
OAuth authorize endpointyour-auris-domain.com/api/oauth/authorizeauth.yourdomain.com/api/oauth/authorize
OIDC Discovery issueryour-auris-domain.comauth.yourdomain.com
JWKS URIyour-auris-domain.com/.well-known/jwks.jsonauth.yourdomain.com/.well-known/jwks.json
Email links (magic links, verification)your-auris-domain.com/...auth.yourdomain.com/...
SDK domain configyour-auris-domain.comauth.yourdomain.com

After setting a primary custom domain, update your SDK initialization to use the new domain. For example, in @auris/js: new AurisClient({ domain: 'auth.yourdomain.com', clientId: '...' }). The OIDC Discovery endpoint will reflect the new issuer automatically.

DNS Verification Methods

Auris supports two DNS verification methods:

Used for subdomains. The CNAME record serves dual purpose — it verifies ownership and routes traffic to Auris.

Type: CNAME Host: auth.acme-corp.com Value: your-auris-domain.com TTL: 3600 (or Auto)

TXT Verification

Alternative method when CNAME is not suitable. A separate TXT record is added under the _auris-verify subdomain.

Type: TXT Host: _auris-verify.auth.acme-corp.com Value: auris-verify-mno345pqr678 TTL: 3600 (or Auto)

With TXT verification, you must also configure a CNAME or A record separately to route traffic to Auris.

Permissions Reference

PermissionDescription
admin:allFull access to custom domain management — add, verify, set primary, delete

Custom domain management is typically restricted to tenant administrators. The permission is included in the default admin role.