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:
- Add the domain via the API
- Configure DNS — add the CNAME or TXT record Auris provides
- Verify — Auris checks the DNS record and provisions an SSL certificate
- 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
/api/custom-domainsRequires: admin:allList 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
| Status | Description |
|---|---|
PENDING | Domain added, DNS verification not yet attempted |
VERIFYING | Verification check is in progress |
ACTIVE | Domain verified, SSL certificate provisioned, ready for use |
FAILED | DNS verification failed — the expected record was not found |
DELETED | Domain has been soft-deleted |
SSL Status
| SSL Status | Description |
|---|---|
PENDING | SSL certificate has not yet been provisioned (waiting for domain verification) |
ACTIVE | SSL certificate is active and valid |
EXPIRED | SSL 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
/api/custom-domainsRequires: admin:allAdd 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"
}| Field | Required | Description |
|---|---|---|
domain | Yes | The 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.comTXT verification (alternative method):
TXT _auris-verify.auth.acme-corp.com → auris-verify-mno345pqr678Once the DNS record is propagated, call the verify endpoint.
Error codes
| Code | HTTP | Description |
|---|---|---|
DOMAIN_TAKEN | 409 | This domain is already registered to another tenant |
DOMAIN_EXISTS | 409 | This domain is already added to this tenant |
VALIDATION_ERROR | 400 | Invalid domain format (e.g., bare IP address, localhost) |
APEX_DOMAIN_NOT_SUPPORTED | 400 | Apex 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
/api/custom-domains/[id]/verifyRequires: admin:allTrigger 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
| Code | HTTP | Description |
|---|---|---|
DOMAIN_NOT_FOUND | 404 | Custom domain ID does not exist |
ALREADY_VERIFIED | 400 | Domain 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
/api/custom-domains/[id]Requires: admin:allDelete 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
| Code | HTTP | Description |
|---|---|---|
DOMAIN_NOT_FOUND | 404 | Custom 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
/api/custom-domains/[id]Requires: admin:allUpdate 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
}| Field | Required | Description |
|---|---|---|
primaryDomain | Yes | Set 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
| Code | HTTP | Description |
|---|---|---|
DOMAIN_NOT_VERIFIED | 400 | Cannot set as primary — domain is not yet verified (status must be ACTIVE) |
SSL_NOT_ACTIVE | 400 | Cannot set as primary — SSL certificate is not yet provisioned |
DOMAIN_NOT_FOUND | 404 | Custom domain ID does not exist |
How Custom Domains Work
When a custom domain is set as primary, the following Auris behaviors change:
| Feature | Before | After |
|---|---|---|
| Hosted login page URL | your-auris-domain.com/hosted/login | auth.yourdomain.com/hosted/login |
| OAuth authorize endpoint | your-auris-domain.com/api/oauth/authorize | auth.yourdomain.com/api/oauth/authorize |
| OIDC Discovery issuer | your-auris-domain.com | auth.yourdomain.com |
| JWKS URI | your-auris-domain.com/.well-known/jwks.json | auth.yourdomain.com/.well-known/jwks.json |
| Email links (magic links, verification) | your-auris-domain.com/... | auth.yourdomain.com/... |
| SDK domain config | your-auris-domain.com | auth.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:
CNAME Verification (Recommended)
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
| Permission | Description |
|---|---|
admin:all | Full 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.
Related
- Custom Domains Guide — Step-by-step domain setup and verification
- Custom Domains — Add and verify domains from the Console