Skip to content

App staff authorization ​

Your own staff (support, operations, compliance reviewers) need to act inside your product's runtime: look up a customer, review a record, change a policy. This page defines how that authority is issued, how your app verifies it, and how fast it can be withdrawn. It is separate from two other kinds of people:

WhoWhere they workHow they sign inCovered by
TenancyEngine operatorsThe platform itselfPlatform consoleNever issued into your app's runtime tokens.
Your team in the TenancyEngine console (owner, admin, billing, support, viewer on the application)The TenancyEngine console, to configure your applicationPlatform consoleControl plane only. These roles are not copied into any token your app receives. The platform keeps this team apart from organization members so a team role never grants organization-wide access.
Your customers' adminsTheir own tenant inside your productYour app's customer sign-inCustomer sign-in
Your app staffYour product's runtime, across or inside tenants as you decideYour app's sign-inThis page.

Requires TenancyEngine.Sdk 2.3.0 for the sign-in building blocks and machine access (AddTenancyEngineMachineAccess, released in 2.1.0). Nothing on this page needs an unreleased type. A packaged verifier is planned in tenancyengine#1576.

The contract ​

  1. Staff are tenant members with staff roles. Create a tenant that represents your staff organization (for example acme-staff), define staff roles on your application (for example support, compliance), and attach permission keys to each role. Staff sign in through the same customer sign-in as everyone else. Role definitions and permission keys are managed per application and environment (see the application's Roles and Claims pages in the console).

  2. Authority is the permission claim. The platform puts the role's permission keys into the token as a JSON array in the permission claim, alongside application_id, environment, tenant_id, tenant_slug and role. Name the keys in your own namespace (yourapp.staff.read, yourapp.policy.write).

  3. Your verifier decides, from the token alone. A staff-only route accepts a request when all of these hold:

    • the token is valid: signature, expiry and issuer (the authority the platform reports for your environment);
    • application_id equals your application id and environment equals your running environment;
    • tenant_id is present and equals your staff tenant;
    • permission contains the key the route needs;
    • the token has no organization_id / organization_role claim. Those two appear only when tenant_id is absent, which is the shape of a TenancyEngine organization login. A route that requires tenant_id rejects that shape by construction.

    Sample checks are in Customer sign-in.

  4. Servers use machine access, not a person's token. Back-office jobs and customer servers that call your API use machine access: per-tenant credentials, tokens of at most 300 seconds, an audience bound to your application and environment, and permission scopes in your namespace. Verify them with AddTenancyEngineMachineAccess and RequireTenancyEngineMachineScope("yourapp.sync.read"). A machine token is never a substitute for a person: it carries no individual identity, so actions that need an accountable person go through a signed-in staff member.

Revocation ​

There is no token introspection and no gateway call to ask "is this token still good". The bound on how long a withdrawn permission keeps working is the access-token lifetime (read exp from the token) plus, for a person who stays signed in on a session of yours, your own session lifetime.

  • Removing a staff member from the staff tenant, or changing their role, takes effect in the next token the platform issues.
  • The platform re-validates application, organization and tenant membership on every refresh-token grant, so a revoked member cannot refresh into a new token.
  • An organization's security policy (session timeout, IP allowlist) is applied on refresh as well.
  • If your app keeps its own session cookie, that cookie is your bound. Keep staff sessions short and do not use sliding expiry for them.
  • For an action that must not outlive a revocation (policy changes, data export), re-check the person against the platform on the action itself, or require a token minted within the last few minutes (iat).

Not provided ​

  • A packaged verifier or authorization policy helper: tracked in tenancyengine#1576.
  • Introspection or a per-request revocation endpoint for a person's access token.
  • Staff roles that are issued into a customer's tenant: staff work in your staff tenant. If staff must see a customer's data, your app grants that access in its own database and records it in its own audit log (see Policy storage and audit).

TenancyEngine platform documentation