Slack OAuth Token Rotation and SCIM Bearer Tokens: One Expiry Policy or Two?
0 reputation · 12 May 2020, 10:32 UTC
0 reputation · 12 May 2020, 10:32 UTC
A platform team standardizing on least privilege for Slack faces two credential systems with incompatible lifecycles: OAuth 2.0 token rotation for installed app tokens, and the long-lived bearer token issued for SCIM provisioning.
Rotation is opt-in and produces short-lived access tokens with single-use refresh tokens; SCIM tokens carry no expiration and can only be revoked manually. Dead credentials surface as 401 responses with invalid_auth or token_revoked, but there is no API to query a token's remaining lifetime, and a failed or concurrent refresh can leave an installation with no valid tokens. SAML SSO session limits, meanwhile, do not touch tokens already issued.
offline scope required for rotating user tokens be treated as a least-privilege exception, and on what basis?Behavior described here reflects Slack's developer documentation at the time of writing; the OAuth, token rotation, and SCIM pages should be re-checked before this policy is finalized.
No. One unified expiry-and-revocation policy cannot realistically govern Slack OAuth 2.0 token rotation and SCIM bearer tokens together. They have incompatible lifecycles and revocation mechanisms. Treat them as two separate credential classes with separate monitoring and runbooks.
offline scope to obtain a refresh token. Without it, no rotation is possible.expires_in field in the issuance response. They can only be invalidated by manual revocation in the admin console or via the admin revocation API.invalid_auth or token_revoked from API calls.OAuth rotation is time-bound and refresh-driven. SCIM is persistent until manual action. Because SCIM tokens never expire automatically, a single expiry policy would either force artificial expiry on OAuth tokens or leave SCIM tokens with no automated expiry at all. Failed or concurrent refresh attempts can consume the single-use refresh token and invalidate the current access token, leaving the installation without a valid credential until a new authorization is completed.
invalid_auth / token_revoked responses. For OAuth, alert on consecutive refresh failures. For SCIM, alert on provisioning failures and maintain an inventory of active SCIM tokens with last-used timestamps.offline. Treat offline as a required exception for any app that needs persistent background access. Do not grant it to user-facing only flows. Document the exception and review it on each app.Uncertainty note: Slack documentation is the source of truth and changes over time. The behavior described reflects developer documentation at time of writing and requires current verification before finalizing policy.
One diagnostic detail that changes the recommendation: are the OAuth installed app tokens and the SCIM bearer token managed by the same app installation and workload? If they are separate services, isolation is simpler. If they are co-managed, the risk of a single failure cascading to both provisioning and app access increases.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.