Identity resolution is how the SDK decides which grant backs a givenDocumentation Index
Fetch the complete documentation index at: https://docs.alterauth.com/llms.txt
Use this file to discover all available pages before exploring further.
app.request() call. Three modes exist, and every call site uses exactly one.
Pick the mode based on what the call site has on hand:
- JWT identity — there’s a logged-in end user, the app has an IDP configured.
- Explicit
grant_id— the call has no end user, or explicit grant control is needed. - Headless — the call has no end user and no
grant_idyet (one-time bootstrap flows).
1. JWT identity — for apps with logged-in users
The app has an identity provider configured. Construct the SDK with auser_token_getter that returns the calling user’s JWT; the SDK includes the JWT on every request and the backend resolves the user’s grant from it.
grant_id in its own database. Deprovisioning a user in the IDP automatically locks them out of grants they own.
2. Explicit grant_id — for scripts, batch jobs, system-principal grants
Pass an explicit grant_id per call. Use this when:
- The call has no end user (cron jobs, webhook handlers, system-principal managed secrets).
- Explicit control over which grant a request uses is required.
3. Headless — for CLIs, notebooks, agent bootstrap
app.connect() opens a browser, walks through OAuth, and returns a grant_id usable immediately. No frontend, no callback URL, no JWT.
Picking one
Ambiguous resolution
A JWT can match more than one grant if the user has connected the same provider multiple times (personal + work Gmail). The backend raisesAmbiguousGrantError with the matching account identifiers; application code passes account=… on retry to pick one.
What’s next
- Connections — OAuth grants resolved by these modes.
- Managed secrets — operator-provisioned grants.
- Call APIs on behalf of users — JWT identity in production.