Context
0051 made identity one Better Auth service and listed every sign-in method and credential type as part of it. Two later decisions change that. Stackra ships packages, not services (0075), and identity will also be offered as a hosted Figentra OS service, which needs a remote driver (0076). The open-core split moves enterprise identity and the authorization engine to Pro (0077).Decision
@stackra/identityis a driver package. Its local driver is built on Better Auth. A remote driver that calls the Figentra OS identity service is designed with the contract now and built later. Whichever service registers the local driver owns users, sessions and credentials, and no other service reads its tables (0014).- Free sign-in methods are configuration, per product: magic link, social, password, passkeys and username. SSO, SCIM, phone sign-in and the OAuth provider plug in as Pro.
- On mobile the session token is stored in SecureStore, never in plain app storage.
@stackra/iam(free) is RBAC behindcheck(subject, relation, object), with no dependency on the scope tree. Callers use onlycheck().@stackra-pro/iam-relations(a Zanzibar-style engine) and@stackra-pro/scopeare drivers behind the samecheck(). OpenFGA, SpiceDB and Cedar stay deferred (0011).- Personal access tokens are free; tenant service tokens are Pro. Tokens are shown once, stored hashed, scoped and revocable.
- Operator endpoints are audited: each call publishes an audit event (0047), and a call whose event cannot be recorded is refused.
- Changes to identity or IAM need a blocking security review.
Consequences
- A product moves from the local driver to hosted identity without changing callers, provided the contract never leaks local-driver assumptions.
- OAuth apps, which 0051 put in the first build, are now a Pro feature. Their scope model and consent flow are designed with the Pro package.
- Better Auth is a dependency of the local driver only.
Enforcement
Planned: a test thatcheck() is the only authorization entry point other members import, a token-storage test (hashed at rest), an identity driver conformance suite run against the local driver, and the security-tenancy-reviewer agent on every change to these packages. Nothing checks this today.