01 Model
Realm and tenant
- A realm is one set of users, one WebAuthn RP ID and one login origin.
- A tenant belongs to one realm and has a 16-byte ID. An application without tenants uses the root tenant: 16 zero bytes.
- A passkey belongs to a realm, because it is bound to the RP ID. Tenants on other domains use the provider (08) and send the user to the login origin. Implementations MUST NOT use related origins to share passkeys between tenants.
Isolation
- Every tenant-scoped storage operation takes the tenant as an argument. A form without one MUST NOT exist.
- Every tenant-scoped MAC, derivation and token includes the tenant.
- Each tenant has its own issuer, and its own provider keys.
- An identifier from one tenant that is used in another gives the same refusal as an unknown one.
User
A user has an ID (16 bytes, random by default; an application maps its own IDs to 16 bytes), a state (active or disabled)
and credentials. Names, addresses and profile data belong to the application. An identifier such as a handle or an
email address is optional, and unique in the realm if used.
Disabling a user ends sessions, tokens and device keys in the same commit.
Entering a tenant
A user may enter a tenant with an active membership (14). A session is for one tenant. Entering another tenant creates another session, and can need another login if that tenant’s policy is stricter. The library stores no roles: the application adds its own columns to the memberships table.
Credentials
| Kind | Held by | Proves |
|---|---|---|
| Passkey | A person | The person |
| Device key | A CLI, native app or machine | The device, and the user that approved it |
| Session key (DPoP) | A browser or app | The session |
| API key (13) | Whoever has it | The scopes that its user gave it |
| External identity | A person at another provider | A claim, never a login |
| Recovery method | A person | Permission to create a passkey |
Proof
A successful check gives an Authenticated value:
| Field | Content |
|---|---|
subject | User or device |
tenant | Tenant |
level | first_party, connected(client, scopes) or api_key(id, scopes) |
methods | What was proved, for example passkey with user verification |
proved_at | Time of the last passkey assertion |
binding | Key thumbprint, or cookie, or bearer |
Only the library can create it. A handler states what it needs in its type: level, maximum age, binding. A request that does not have it never reaches the handler.
Policy
A policy is a set of requirements. Policies from the profile, instance, tenant and route combine to the strictest:
| Requirement | Combine |
|---|---|
| Lifetimes | Minimum |
| Maximum age of a passkey assertion | Minimum |
| Passkey must not sync (BE flag clear) | Or |
| External identity required: list of providers | Both lists must be satisfied |
| Signup modes, recovery methods | Intersection |
| Binding required | Or |
Combination MUST be associative, commutative and idempotent. An empty signup set means that nobody can sign up.
A requirement that the current login does not meet gives the refusal step_up_required, with the requirement.