Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt

Use this file to discover all available pages before exploring further.

A grant is a stored authorization to call a provider on behalf of a principal. Every Alter call passes through a grant. A grant is identified by a UUID (grant_id), refers to (but does not contain) the encrypted credential in the vault, and is revocable independently of the underlying credential.

How a grant is created

Two creation paths:
  • OAuth grants — created when an end user completes the OAuth flow at a provider (via Alter Connect, app.connect(), or a redirect flow). See Connections.
  • Managed-secret grants — created when an operator binds a stored credential to a principal (via the developer portal or app.create_managed_secret_grant()). See Managed secrets.
Both produce the same grant_id, both reach the same app.request() method.

Principals

A grant is owned by a principal — the who the grant belongs to. Four kinds:
PrincipalWhat it representsCreated by
UserAn end user authenticated via the app’s identity providerOAuth flow, or operator binds a managed secret to one user
GroupA set of users defined in the identity providerOperator binds a managed secret to an IDP group
SystemThe app itself — no human or agentOperator provisions a managed secret with no principal binding
AgentA named, operator-provisioned workload identityOperator binds a managed secret to an agent
Principal kind decides how the SDK resolves the grant at call time. See Identity resolution.

Credential type vs principal type

Credential type (OAuth vs managed secret) and principal type (user/group/system/agent) are independent axes. A user-principal grant can be backed by either an OAuth credential or a managed secret. The SDK call site is the same.
CredentialCan back which principals
OAuthUser
Managed secretUser, Group, System, or Agent
A user-principal grant backed by a managed secret resolves under JWT identity the same way an OAuth grant does — the principal type drives resolution, not the credential type.

Grant lifecycle

  1. Createdstatus = active.
  2. Used — every successful app.request() updates last_used_at.
  3. Expired — OAuth grants auto-refresh; managed-secret grants stay valid until rotated.
  4. Revoked — by the end user (in the Wallet), by an operator (in the portal or via SDK), or by policy (TTL elapses, scope mismatch detected).
A revoked grant raises GrantRevokedError on the next call.

What’s next