Add slack access token in runtime
See original GitHub issueSince i want to make the slack bot installable with oauth2, is there a method that i can use to add the access token after the bot instance is created?
Currently the token is added at SlackBot
is run, which means i need to provide it at the constructor. However with oauth the token is given after the constructor is run. So now i just enter an empty string first and then manually change the _token
property in SlackOAuthClient
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Create and regenerate API tokens - Slack
Re-issue a token · From your desktop, visit the auth.revoke page at api.slack.com/methods/auth.revoke/test to revoke your token. · Then, visit the Legacy Tokens...
Read more >Tokens & Installation — slackclient (Legacy Python Slack SDK)
We recommend you pass tokens in as environment variables, or persist them in a database that is accessed at runtime. You can add...
Read more >Tokens & Authentication - python-slackclient - Read the Docs
Slack tokens are the keys to your—or your customers'—teams. ... in as environment variables, or persist them in a database that is accessed...
Read more >Slack OAuth: How to Implement It in a Node.js App - Fusebit
Connecting to Slack From Node.js · Create a New Slack Team and Workspace · Get an OAuth Token in Slack · Setting Up...
Read more >chat.postMessage xoxb token that works to post messages to ...
I see there is an OAuth Access Token (xoxp) and Bot User OAuth Access Token (xoxb) in the Slack API Bot Dashboard under...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Although we have not implemented
mapTeamToAccessToken
yet, you can trybottender@0.14.15
first.As
bottender@0.14.15
using new version of underlying client (messaging-api-slack@0.6.10
), you can put{ token: YOUR_CUSTOM_TOKEN }
as options incontext.postMessage()
,context.sendText()
andcontext.postEphemeral()
.Hi @IniZio ,
After reading some Slack documents, I guess we should try to support
mapTeamToAccessToken
inSlackBot
like we havemapPageToAccessToken
inMessengerBot
(ref: messenger-multi-pages example).After that, you can implement the OAuth procedure to save a team’s ID and access token in a database and let the
mapTeamToAccessToken
function to read your database for access tokens.