Slack token rotation limits: user token expiry behavior without bot token rotation
0 reputation · 02 Mar 2024, 19:39 UTC
0 reputation · 02 Mar 2024, 19:39 UTC
When a granular-permission Slack app opts into token rotation, the documented behavior introduces short-lived user access tokens paired with refresh tokens, while bot tokens reportedly remain non-expiring until uninstall or workspace reset. This asymmetry creates an unresolved design boundary: an app may need to bound user-token lifetime for least-privilege hygiene, yet still manage long-lived bot credentials under a different expiry model.
The exact access-token lifetime, refresh-token reuse rules, and whether classic or Enterprise Grid configurations follow the same pattern are version-sensitive and not fixed across all Slack app types. Because auth.test returns token metadata and scopes but does not confirm whether a rotated token is still within its active window, client-side expiry tracking is required regardless.
Is the non-expiring bot-token behavior guaranteed for all granular-permission apps when rotation is enabled, or does it vary by workspace plan or app configuration? What is the current documented lifetime for a rotated user access token, and are refresh tokens single-use with mandatory rotation on every exchange? Should least-privilege implementations assume bot tokens never expire, or must they handle eventual bot-token invalidation separately from user-token refresh logic?
No, non-expiring bot-token behavior is not guaranteed across all workspace plans. Enterprise Grid organizations can enforce additional rotation or retention policies that invalidate bot tokens independently of app uninstall. User access tokens under rotation typically expire within 1 hour. Refresh tokens are single-use: each exchange returns a new access token and a new refresh token, invalidating the previous pair. Least-privilege implementations must handle bot-token invalidation separately from user-token refresh logic.
oauth.v2.access call with grant_type=refresh_token.| Factor | Classic / Standard Plan | Enterprise Grid |
|---|---|---|
| Bot token expiry | Only on uninstall, revoke, or workspace reset | May be subject to org-level token rotation/retention policies |
| User token lifetime | ~1 hour (configurable via app manifest? No — fixed by Slack) | Same baseline, but org admins can enforce shorter windows |
| Refresh token reuse | Strictly single-use | Strictly single-use |
auth.test calls) and a re-install/re-authorization flow for when they eventually become invalid.auth.test returns an expires timestamp, but it does not confirm whether a rotated token is still within its active window. Store the expires value from the token response and refresh proactively (e.g., 5–10 minutes before expiry).oauth.v2.accessTokenScopes and auth.test with a rotated user token; note the expires timestamp.oauth.v2.access with grant_type=refresh_token. Confirm you receive a new access token, new refresh token, and that the old refresh token is rejected on a second attempt.Are you operating in an Enterprise Grid organization with org-level token policies enabled? If yes, bot tokens may be forcibly rotated on a schedule independent of your app. If no (Classic/Standard plan), bot tokens only expire on uninstall, revoke, or workspace reset.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.