Organization Domains
Organization domain verification in Frontier allows users with email addresses from trusted domains to automatically join organizations without explicit invitations. This feature is particularly useful for companies that want to allow all employees from their corporate domain to access their Frontier organization.How It Works
There are two ways users can be added to an organization in Frontier:1. Trusted Domain Auto-Join
If a domain (e.g.,acme.com) is verified as a trusted domain for the Acme Corp organization, any user with an email address matching *@acme.com can automatically join the organization after authenticating.
2. Explicit Invitation
Users with public domain email addresses (e.g.,@gmail.com) must be explicitly invited to join an organization.
Domain Verification Process
To prevent unauthorized use of your domain, Frontier requires proof of domain ownership through DNS verification.DNS Verification Overview
Every domain has DNS records that are publicly viewable on the internet. DNS records tell computers how to find websites and route email. Frontier uses DNS TXT records to verify domain ownership:- Frontier provides a unique verification token
- You add this token as a TXT record to your domain’s DNS
- Frontier performs a DNS lookup to verify the token matches
- If verified, the domain is marked as trusted
Step-by-Step Verification
curl --location --request POST 'http://localhost:7400/v1beta1/organizations/{org_id}/domains' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "acme.com"
}'
{
"domain": {
"id": "dom_abc123def456",
"name": "acme.com",
"org_id": "org_123",
"token": "_frontier-domain-verification=LB6U2lSQgGS55HOy6kpWFqkngRC8TMEjyrakfmYC2D0s+nfy/WkFSg==",
"state": "pending",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
}
Value/Content:
_frontier-domain-verification=LB6U2lSQgGS55HOy6kpWFqkngRC8TMEjyrakfmYC2D0s+nfy/WkFSg== Cloudflare
- Go to DNS settings
- Click “Add record”
- Select TXT type
- Name:
@ - Content:
_frontier-domain-verification=LB6U2l... - Click Save
Route53
- Select your hosted zone
- Click “Create record”
- Record type: TXT
- Name: leave blank or
@ - Value:
_frontier-domain-verification=LB6U2l... - Click Create
GoDaddy
- Go to DNS Management
- Click “Add” under Records
- Type: TXT
- Name:
@ - Value:
_frontier-domain-verification=LB6U2l... - Click Save
DNS changes can take anywhere from a few minutes to several hours to propagate globally. Typically:
curl --location --request POST 'http://localhost:7400/v1beta1/organizations/{org_id}/domains/{domain_id}/verify' \
--header 'Authorization: Bearer <token>'
{
"domain": {
"id": "dom_abc123def456",
"name": "acme.com",
"org_id": "org_123",
"state": "verified",
"verified_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"error": {
"code": "verification_failed",
"message": "DNS verification record not found. Please ensure the TXT record is added and propagated."
}
}
Domains must be verified within 7 days of being added. After 7 days, unverified domains are automatically removed and you must restart the process with a new verification token.
Verification Token Format
The verification token has a specific format:- Prefix:
_frontier-domain-verification=- Identifies this as a Frontier verification token - Token: 40+ character random base64-encoded string - Ensures uniqueness and prevents guessing
Using Verified Domains
Once a domain is verified, users can automatically join the organization.List Joinable Organizations
Users can query which organizations they’re eligible to join based on their email domain:joinable_via_domain field contains organizations the user can join because their email domain matches a verified domain.
Join Organization
User can join an organization they’re eligible for:Managing Domains
List Organization Domains
View all domains configured for an organization:Domain States
| State | Description |
|---|---|
pending | Domain added but not yet verified |
verified | Domain ownership verified via DNS |
failed | Verification failed (manual review may be required) |
Remove Domain
Remove a domain from an organization:Multiple Domains
Organizations can have multiple verified domains:Example: Complete Flow
Here’s a complete example of setting up domain verification:Security Considerations
DNS Security
DNS Security
Ensure your DNS provider supports:
- DNSSEC (Domain Name System Security Extensions)
- Two-factor authentication
- Audit logs for DNS changes
- IP whitelisting for DNS management
Domain Ownership
Domain Ownership
Only add domains you own or control:
- You cannot verify domains you don’t own
- Attempting to claim others’ domains will fail
- Domain verification proves ownership
Email Validation
Email Validation
Frontier validates email domains during authentication:
- Email addresses are normalized and validated
- Domain matching is case-insensitive
- Subdomains are NOT automatically included
Token Expiration
Token Expiration
Verification tokens expire after 7 days:
- Prevents stale verification attempts
- Expired tokens require new domain addition
- No security risk from expired tokens
Subdomain Handling
Verified domains do NOT automatically include subdomains. Each subdomain must be verified separately.
- Verified:
acme.com→ Matches[email protected] - Verified:
acme.com→ Does NOT match[email protected] - To match both, verify both domains:
acme.comeng.acme.com
Troubleshooting
Verification Fails
Error: “DNS verification record not found” Solutions:- Check DNS propagation - Use dnschecker.org
- Verify TXT record value - Ensure exact match including prefix
- Check record name - Should be
@or root domain - Wait longer - DNS can take up to 48 hours
- Clear DNS cache -
sudo dnsmasq -kor restart DNS service
Token Expired
Error: “Domain verification token expired” Solution: Delete the domain and re-add it to get a new token:Users Cannot Join
Issue: User with verified domain cannot join organization Checklist:- Domain state is “verified” (not “pending”)
- User’s email domain exactly matches verified domain
- User is authenticated with correct email
- Organization has not reached member limit
- User is not already a member
Multiple DNS Records
Question: Can I have multiple TXT records for the same domain? Answer: Yes! DNS supports multiple TXT records. The verification token can coexist with other TXT records (SPF, DKIM, etc.).Best Practices
- Verify promptly - Add DNS record and verify within 7 days
- Document tokens - Keep verification tokens in secure documentation
- Monitor domains - Regularly review verified domains
- Use DNSSEC - Enable DNSSEC on your domain for added security
- Clean up records - Remove verification TXT record after successful verification
Related Documentation
User Authentication
Learn about user authentication flows
Organizations
Understand organization structure and management