Skip to content

Token rotation/refresh not working #962

@ccaruceru

Description

@ccaruceru

Hi, I made a user-driven app with Bolt for python which uses a custom InstallationStore and OAuthStateStore to support google cloud storage, and the Slack app has token rotation enabled. But after a while the requests to Slack servers stop working and getting a not_authed error. E.g.:

slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/reactions.get)
The server responded with: {'ok': False, 'error': 'not_authed'}

If I understand correctly, the rotation of the token should be handled by the Bolt framework. If that's not the case, is there anything else that must be implemented to support the refresh/rotation?

Environment:

  • slack_bolt version: 1.16.2
  • Python runtime version: python 3.10
  • OS info: Not sure. Running in Google App Engine. Assuming linux based.

Steps to reproduce:

Check the development setup guide here to get the repo running locally.

Expected result:

In the past the app was running w/o token rotation enabled on the Slack level and there were no authentication issues during the lifetime of the app when users interacted with it. But after activating it there are not_authed errors being thrown by the server after a period of time (w/ or w/o user inactivity in the app).

The workaround is to reinstall the app by visiting the /slack/install endpoint.

Actual result:

The Slack server communication works with no authentication issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions