Accounts and isolation
Each account has its own realm. This page says what that separates.
An account is the record RealmSSO keeps for one of your customers. It is sometimes called a tenant. Each account has its own realm. A realm is a separate sign-in space with its own users, clients, identity-provider links and signing keys.
Between realms, tokens, sessions and identity-provider links do not cross.
How the realm is set up
RealmSSO creates the realm in the same request that creates the account. The realm name is kr- followed by the account id. The client ID for your application is org-<slug>, so it contains the account's short name (the slug).
The URLs that your customers register do not contain the customer's name. The ACS URL and the redirect URI contain the realm name and a connection ID. The accounts API returns the account's realm name in the field keycloakRealm.
What the realm separates
We ran attacks between two realms on a test deployment of the sign-in service. The table shows three of them. Each one failed.
| Attack between realms | Result |
|---|---|
| Sign-in through another realm’s identity-provider alias | HTTP 400. Identity-provider aliases belong to one realm. |
Authorize request with another realm’s client ID (org-<other>) | HTTP 400 "Client not found". Client IDs belong to one realm. |
| SSO cookie replay | The cookie is limited to its own realm’s path. The browser does not send it to another realm. |
The token's issuer is the account's own realm URL. Your application must check the issuer and the audience. A standard OIDC library checks the issuer by default.
Inside a realm, the server checks that an account owns an object before it reads or changes it. If the server cannot prove ownership, it refuses.
Deleting an account
Deleting an account also deletes its realm, in a second step after the account. If that step fails, RealmSSO records the failure, and the realm can remain. See Data retention and deletion.
Email domains are verified with DNS
An account claims an email domain. The claim counts only after a DNS TXT record verifies it. RealmSSO checks the record at _realmsso-challenge.<domain>. You can start a claim in the dashboard. The routes below also accept a dashboard session token. They do not accept an API key.
/api/v1/accounts/:id/domain/claimRecords the domain and issues a TXT challenge.
/api/v1/accounts/:id/domain/verifyChecks the challenge against real DNS and records the result. Setting domain with PATCH /api/v1/accounts/:id takes the same path. A new domain never inherits the verification of an earlier one.
Two accounts cannot hold the same domain. The check ignores letter case. A collision returns 409.
GET /api/v1/sso/resolve routes a login by email domain (see Connections). It needs no credential. It matches only a verified domain. It gives one answer for an unknown domain, an unverified domain and a domain with no active connection. For a match, it returns the account's id, name and slug, and its oldest active, provisioned connection.