Home Realm Discovery
Home Realm Discovery (HRD) uses the email domain to decide whether a user should be routed to an upstream enterprise provider or fall back to standard hosted auth.
Endpoint
POST /api/auth/lookup-email
Request
{
"email": "user@acme.com"
}
Response
When the domain is verified and mapped to an enabled upstream provider:
{
"connection_id": "okta-acme",
"provider_name": "Acme Okta",
"domain_verified": true,
"auth_method": "upstream"
}
Fallback behavior:
auth_method: "password"when the domain is verified but no enabled upstream route is availableauth_method: "oauth"when no verified route exists for the email domain
How to configure it
- Create a domain route with
POST /api/organizations/:org_slug/domain-routes - Verify the domain route with
POST /api/organizations/:org_slug/domain-routes/:domain_id/verify - Create an upstream provider with
POST /api/organizations/:org_slug/upstream-providers - Patch the domain route so
upstream_provider_idpoints at that provider
Client usage
Typical flow:
- Ask for the user’s email
- Call
POST /api/auth/lookup-email - If
auth_method === "upstream", send the user to/auth/:provider?connection_id=... - Otherwise continue with password or hosted OAuth UX