# A realm per business customer

> Give each business customer a realm beneath yours, with their own users, apps and administrators, while you keep oversight from above.

When you sell to businesses, each business customer has users of its own, and often wants to run them itself. Give
the business customer a realm beneath your customer realm: their users sign in there, their administrators add
and remove them, and nothing in it reaches your realm or another customer's. You keep oversight, because reach
descends from your realm and never climbs.

## Before you begin

- **Privilege:** `RealmOwner` in your customer realm, to create the realm beneath it and hand it over.
- **Where:** the API, to create the realm and to grant its administrators.
- **The business customer's host name,** under `cvyuh.com`, such as `foobar-acme.cvyuh.com`, and the people who will
  administer it.

## How it works

A realm created beneath yours is a full realm: its own users and groups, its own apps, its own signing keys and sign-in
settings, and its own host names. A token issued in it means nothing in your realm or a sibling's.

Who runs it is decided by [Delegated administration](/platform/realms/delegated-administration/). Make a
group of the business customer's administrators in their realm, and grant that group `RealmOwner` there: they
administer their realm and any realm they create beneath it, and nothing above. Your own administrators, holding
`RealmOwner` in your realm, reach theirs too.

| Who | Reaches |
|---|---|
| Your administrators, in your customer realm | Your realm, and every business customer's realm beneath it |
| The business customer's administrators, in their realm | Their realm, and the realms they create beneath it |
| The business customer's users | Sign-in to their own realm only |

Your app reaches each business customer's users through their realm: it's registered there, and trusts that realm's
issuer. See [Connect one app to many business customers](../../guides/connect-one-app-to-many-business-customers/).

## Set it up

1. **Create the business customer's realm** beneath yours, with the host names their users will sign in at, and a
   password for its first administrator. See [Realms and sub-realms](/platform/realms/sub-realms/).
2. **Hand it over.** In the new realm, put the business customer's administrators in a group and grant it
   `RealmOwner`, or `RealmViewer` for a group that only looks. See
   [Delegated administration](/platform/realms/delegated-administration/).
3. **Add their users,** or let their administrators add them. See
   [Create customer accounts](../../registration/create-customer-accounts/).
4. **Connect your app** to the new realm. See
   [Connect one app to many business customers](../../guides/connect-one-app-to-many-business-customers/).

## What users see

The business customer's users sign in at their realm's host name, with its own settings and wording. They never see
your realm or another business customer's.

## Limits and defaults

| Limit | Default | Can it be changed? |
|---|---|---|
| Host names per realm | 3 | Cvyūh raises it on request |
| Realms directly beneath a realm, and levels beneath it | No limit | Cvyūh can set a limit per realm, on request |
| What descends from your realm | `RealmOwner` and `RealmViewer` over everything | Narrower privileges apply only in the realm that holds them |

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| The business customer's administrator is refused (`403`) in their realm | Their group doesn't hold a privilege there, or holds `RealmViewer` | Grant the group `RealmOwner` in their realm |
| Your administrator with a narrower privilege can't reach a business customer's realm | Only `*REALM/*` privileges reach the realms beneath | Grant `RealmOwner` or `RealmViewer` in your realm, or a privilege in theirs |
| Their users can't sign in at all | The realm is suspended | Activate it |
| Creating the realm is refused with `400`, naming a nesting limit | A limit on realms beneath yours has been reached | Create it elsewhere, or ask Cvyūh to raise the limit |

## Audit records

Creating, suspending and deleting the realm are recorded as changes to the realm. Each grant and each administrator's
decision, allowed or refused, is logged, naming the privilege it rested on; see
[Delegated administration](/platform/realms/delegated-administration/).

## Good to know

- **Suspending stops a business customer at once.** Its host names stop answering, so no one signs in or gets a
  token, and nothing is deleted: activating it brings everything back.
- **Only "everything here and below" descends.** A narrower grant, such as one service in your realm, applies only
  in the realm that holds it.
- **One person in two business customers has two accounts,** one in each realm.
- **Their own directory can't feed it yet.** Provisioning from a business customer's own directory over SCIM is
  planned; see [What's next for lifecycle](/directory/lifecycle/whats-next/#scim-provisioning).

## Related

- [Connect one app to many business customers](../../guides/connect-one-app-to-many-business-customers/): the
  developer's side.
- [Realms and sub-realms](/platform/realms/sub-realms/): create, suspend and delete realms.
- [Delegated administration](/platform/realms/delegated-administration/): who may administer a realm.
- [A realm per brand](../brand-realms/): realms by brand rather than by customer.
