Home / Companies / WorkOS / Blog / Post Details
Content Deep Dive

Your access token is a snapshot, not a live query

Blog post from WorkOS

Post Details
Company
Date Published
Author
Maria Paktiti
Word Count
2,152
Company Posts That Month
44
Language
English
Hacker News Points
-
Post removed?
No
Summary

Access-token permissions are signed snapshots of a user’s organization-specific role at the time of issuance rather than live authorization decisions, so role or permission changes generally take effect only after token expiration or an explicit session refresh, while organization membership deactivation revokes sessions immediately. Applications should distinguish a session with no selected organization, which requires organization selection, from an empty permissions array, which represents a valid role with no granted capabilities. Switching organizations requires a new token and may trigger reauthentication for SSO or MFA, and servers must authorize each request using the newly supplied token rather than cached decisions. Permission checks establish general capability but do not establish access to a particular record, so data-layer queries must enforce ownership using the signed organization ID from token claims instead of caller-controlled request parameters. Permissions, billing-derived entitlements, and targeted feature flags may appear similarly in tokens but serve distinct purposes and share token staleness constraints. Because JWT size is limited and cached claims can become outdated, frequently changing, resource-specific, or large-scale authorization decisions should be evaluated through runtime authorization checks. Authorization should rely on stable permission slugs rather than role slugs, since role meanings, custom role identifiers, and role assignments can change across organizations.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.