Token types at a glance
Validating access tokens
Access tokens are JWTs signed with RS256. Validate them locally on every request — no per-request introspection round-trip to Busha.1
Fetch and cache the JWKS
Fetch public keys from Read the canonical
<issuer>/.well-known/jwks.json. Cache for ~5 minutes. Refetch when you encounter a kid (key ID) that is not in your cache.issuer string from /.well-known/openid-configuration at startup and pin against it — do not hardcode.2
Match the key and verify the signature
Match the JWT header’s
kid to a key in the JWKS. Verify the RS256 signature with that key.3
Verify the standard claims
4
Enforce scopes on every endpoint
Check the
scp claim (a space-separated string or array depending on your library) against the scope required by the endpoint being called. A token with scp="balances:read" cannot call a transfers endpoint.Refreshing tokens
Every successful refresh issues a new(access_token, refresh_token) pair and immediately invalidates the old refresh token.
- Persist the new pair atomically before discarding the old one. If persistence fails, you lose the session.
- If a previously-rotated refresh token is replayed, Busha revokes the entire token family immediately.
- Any
invalid_grantresponse on a refresh is a hard disconnect — prompt the user to re-authorize. - The 30-day lifetime is sliding: each successful refresh resets the clock by another 30 days.
Revoking tokens
When a user disconnects your integration, revoke the refresh token:200 with an empty body whether or not the token was valid — this is intentional and prevents leaking token validity.
Revoking a refresh token prevents future refreshes immediately, but does not invalidate a currently-issued access token. The access token continues to validate until its
exp (~1 hour). For instant revocation on critical paths, consider maintaining a server-side allowlist that your backend checks.Storage requirements
What never to log
Never write these values to application logs, request logs, or error trackers:client_secretaccess_tokenrefresh_tokencode_verifier- Authorization
code id_token
client_id, jti, sub, scope list, request IDs, trace IDs.