Realms
A realm holds a population of users and the ways they sign in. A tenant can have several realms, such as one for employees and one for customers, and an issuer sends each sign-in to one of them. This page shows how to create a realm, decide how accounts come to exist in it, and add its sign-in methods.
Before you begin
Section titled “Before you begin”- Identity server 1.56 or later,
awctl0.22 or later, and Terraform provider 0.19 or later. - A tenant administrator seat, or a service account holding
tenant.admin. See Service accounts.
Create a realm
Section titled “Create a realm”- In the console, go to Realms and click New realm. If the sidebar shows no realm section yet, press Cmd+K or Ctrl+K and choose New realm.
- In Display name, enter a name, such as
Employees. - Leave Type as Standard (Authwise-managed). External (delegated) stores users in a backend of your own.
- Click Create realm.
With awctl, in the tenant’s context:
awctl identity realms create --display-name EmployeesWith Terraform:
resource "authwise_realm" "employees" { display_name = "Employees"}A new realm has no sign-in methods and every way of creating an account is closed. The next two sections open them.
Decide how accounts come to exist
Section titled “Decide how accounts come to exist”Each way an account can be created in the realm is a channel, closed until you open it. Open only the channels you need.
| Channel | What it allows | Open it when |
|---|---|---|
| Self-signup | Anyone can create an account through a sign-in method that offers a signup form, such as a password or a magic link. | The public can sign up, or the realm signs people in with a magic link only. |
| Invitations | An administrator creates the account, and the person completes it through a one-time link sent by email. | You bring people in one at a time, with a password or a magic link. |
| Just-in-time federation | The account is created the first time the person signs in through a federated identity provider, such as SAML or Google. | The realm trusts an identity provider to say who its people are. |
To change the channels, open the realm, go to Configuration, and in Provisioning turn on the channels you need. Click Save.
With awctl, the channels are the realm’s provisioning configuration:
awctl identity realms update REALM_ID \ --config '{"provisioning": {"invitations": true, "invitationTtl": "604800s"}}'invitationTtl is how long an invitation link stays valid, as a number of
seconds. The default is 7 days, and the maximum is 30 days.
With Terraform, build the configuration with the authwise_realm_config
data source:
data "authwise_realm_config" "employees" { provisioning = { invitations = true jit_federated = true }}
resource "authwise_realm" "employees" { display_name = "Employees" config = data.authwise_realm_config.employees.json}Add sign-in methods
Section titled “Add sign-in methods”A sign-in method is a provider of the realm. A realm needs at least one before anyone can sign in. The provider’s display name is the label of its button on the sign-in page.
| Provider | Who proves the identity |
|---|---|
| Username & Password | Authwise, with a password the person sets. |
| Magic link | Authwise, with a link or code sent to the person’s email address. See Sign in with a magic link. |
| Passkey | Authwise, with a passkey on the person’s device. |
| Google, Apple, Microsoft, Facebook, GitHub, LinkedIn | That service’s account. |
| Okta, Auth0, OpenID Connect, OAuth 2.0 | An OpenID Connect or OAuth 2.0 identity provider. |
| SAML 2.0 | A SAML identity provider, such as Microsoft Entra ID. See Sign in through a SAML identity provider. |
To add one:
-
Open the realm, go to Providers, and click New provider.
-
Click the provider type.
-
In Display name, enter the label people see on the sign-in page.
-
Click Create provider.
The console opens the provider’s page, where the type’s own settings are.
With awctl, in the realm’s context:
awctl identity providers create --display-name "Password" --provider-type usernamePasswordThe sign-in page decides what to show from the realm’s providers: a username and password form when the realm has one, otherwise the only provider’s own flow, otherwise a button per provider.
Add second factors
Section titled “Add second factors”Second factors, such as an authenticator app or a passkey, and the rules that say who is asked for one, are on the realm’s Authentication page. A new realm asks for none. The sign-in methods above are the first step of a sign-in; the Authentication page configures the second.
Invite the first users
Section titled “Invite the first users”An invitation creates the account and emails the person a one-time link. It needs the Invitations channel open and a Username & Password or Magic link provider in the realm. With a password provider, the person sets a password at the link. With a magic-link provider, the person confirms the address at the link and is signed in; there is no password. A realm with both lets the person choose. Magic-link invitations need identity server 1.65 or later.
-
Open the realm, go to Users, and click Invite.
-
In Identifier, enter the person’s email address.
-
Click Send invitation.
The console shows Invitation sent, or Invitation ready with the link if the email could not be sent. The link is the invitation itself, so pass it on only through a channel you would trust with a password.
With awctl, in the realm’s context:
awctl identity users invite person@example.comIn a realm with a magic link and no password, the invitation is the only way in while Self-signup stays closed. See Sign in with a magic link.
What’s next
Section titled “What’s next”- Domains and issuers: route an issuer to the realm.
- Sign in with a magic link.
- Sign in through a SAML identity provider.
- Route sign-ins by email domain: send each email domain to its own realm.