What you need as an app: one path from registration to a signed-in user
This page is the single route from "I have a product" to "my users and my customers' servers can call my API through TenancyEngine". Each step names the page that goes deeper. Read it top to bottom once; the steps depend on each other.
Which SDK version to pin: the changelog lists every published version and what it added. Versions that are not on nuget.org yet are marked there as such. Capability minimums:
| Capability | Minimum TenancyEngine.Sdk |
|---|---|
| Runtime calls, tenants, usage | 2.0.2 |
| Customer machine access | 2.1.0 |
| Effective entitlements, free offering at tenant creation | 2.2.0 |
| Webhook secret overlap | 2.3.0 |
| MCP resource helpers | 2.5.0 (2.8.0 recommended: trust is never permissive by omission) |
| Entitlement cache, Standard Webhooks | 2.7.0 |
net10.0 asset | 2.11.0 |
1. Register the application and its environments
Console: Applications > Create application, then Environments and add the environments you need (Development, Staging, Production). An environment owns its API base URL, its OAuth clients and its API permissions, and nothing leaks across environments. The base URL you register becomes the resource identifier for tokens aimed at your API (MCP resource servers).
2. Create an OAuth client and its redirect URIs
Under the environment, add an OAuth client. A browser or mobile app uses a public PKCE client (no secret); a server uses a confidential client. Register every redirect URI exactly: the authorize endpoint refuses any other (redirect_uri is not valid for this client application). Mobile and browser specifics: Mobile and browser apps.
3. Define resource scopes (API permissions)
Under the environment, API permissions > Add permission. Namespace each key with your application slug, for example myapp.reports.read, and describe it for the person who approves it. Platform and sign-in scopes can never be defined here. Details: Customer machine access, step 1.
Do not confuse these with organization API key scopes, which gate your backend's calls to TenancyEngine (API key scopes; the live catalog is GET /api/v1/public/api-key-scopes).
4. Give end users a runtime tenant membership
A token bound to your resource is issued for exactly one tenant, and only a tenant membership counts as the tie between a person and that tenant. Membership of the organization or of the application team is deliberately not a tie. A signed-in person without a tenant membership gets ID2015 ("You do not have a workspace in the application this resource belongs to").
- Customers: create a tenant per customer (
POST /api/v1/runtime/applications/{id}/tenantswith atenants.writekey, optionally withofferingSlugfor a free offering, see Entitlements) and add the customer's users as members by invitation or self-registration. - You, to test as an end user: the owner of the application needs a tenant membership too. Today that means creating a test tenant (Applications > your app > Tenants) and inviting yourself into it, then accepting the invite. There is no one-click "add me" action yet; see what is not self-service yet.
The tenant-user realm is separate from platform operators: Console users are operators, your end users are tenant members and are never given Console permissions.
5. Machine tokens for customer servers
A customer's worker exchanges a machine credential for a short-lived token bound to one tenant, one environment and the permissions you granted. Setup, issuing and verification: Customer machine access.
6. Pick the lane
lab is the local development lane, stage is staging, no label is production. Point the SDK, the OIDC authority and the API base at the same lane, never mixed. Recipe: Develop against lab or staging.
What is not self-service yet
- Adding yourself to a tenant as the application owner (the invite round trip in step 4). Tracked in #1158.
- Assigning a paid offering with an API key. Only free offerings can be assigned at tenant creation; paid plans go through checkout or the Console (#768).
- Public registry releases of the non-.NET SDKs: see the table in the SDK reference.