IM
EN
Docs Home
Menu
Guides

Auth And Token Bootstrap

Acquire bearer tokens and validate auth endpoint behavior before calling Inbox Manager APIs.

inbox-manager client-flow

Auth And Token Bootstrap

Purpose: acquire bearer tokens and verify auth endpoint behavior before calling Inbox Manager APIs.

Boundary note:

  • This flow calls auth.inbox-manager.com endpoints.
  • Those routes are not part of api.inbox-manager.com OpenAPI.

UI Flow

  1. User opens sign-up or sign-in form.
  2. UI submits credentials to https://auth.inbox-manager.com/auth/sign-up or /auth/sign-in.
  3. UI stores returned access token and account context.
  4. UI requests account-scoped token via POST /api/accounts/:account_id/token when needed.
  5. UI uses returned token as Authorization: Bearer <token> for api.inbox-manager.com.

Client Library Flow

const auth = new AuthClient({ baseUrl: "https://auth.inbox-manager.com" });
const session = await auth.signIn({
  email,
  password,
  clientId: "cid_inbox_manager",
});
const accountToken = await auth.issueAccountToken({
  accountId: session.profile.active_membership.account_id,
  bearerToken: session.tokens.access_token,
  audience: "https://api.inbox-manager.com",
});
const api = new InboxManagerClient({
  baseUrl: "https://api.inbox-manager.com",
  bearerToken: accountToken.access_token,
});

HTTP/curl Flow

AUTH_BASE_URL="https://auth.inbox-manager.com"
ORIGIN="https://app.inbox-manager.com"
CLIENT_ID="cid_inbox_manager"

curl -sS "${AUTH_BASE_URL}/.well-known/jwks.json"

curl -sS -X POST "${AUTH_BASE_URL}/auth/sign-in" \
  -H "origin: ${ORIGIN}" \
  -H "content-type: application/json" \
  --data "{\"client_id\":\"${CLIENT_ID}\",\"email\":\"${EMAIL}\",\"password\":\"${PASSWORD}\",\"csrf_token\":\"${CSRF_TOKEN}\"}"

curl -sS -X POST "${AUTH_BASE_URL}/api/accounts/${ACCOUNT_ID}/token" \
  -H "authorization: Bearer ${ACCESS_TOKEN}" \
  -H "content-type: application/json" \
  --data '{"audience":"https://api.inbox-manager.com"}'

Validation Script

  • scripts/auth_probe.sh
  • scripts/auth_bootstrap_accounts.sh