'Azure bot framework Slack channel "Slack API error" because of token_expired
I have a self-hosted Azure bot with a Slack channel. The bot is able to send proactive messages and respond to user mentions after I authorized it with Slack. However, this stops working after some period of inactivity. The request via botbuilder sdk results in "Slack API error" and the underlying error appears to be token_expired.
await turnContext.sendActivity({ text: 'Some message...', textFormat: 'markdown' });
I assumed that token refresh should be fully handled within the framework. Has anyone encountered this issue? Is there some specific configuration that is required?
Solution 1:[1]
Token rotation provides an extra layer of security for your access tokens.
Token rotation is defined by the OAuth V2 RFC. Instead of an access token representing an existing installation of your Slack app indefinitely, the access token expires. A refresh token acts as a long-lived way to refresh your access tokens.
Migrate an existing app to convert token rotation overs setting up token rotation for an existing, modern Slack app.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | PratikLad-MT |
