I am struggling to implement external authentication for slack in my App. My goal is to set a webtrigger that is periodically triggered to send slack messages. As stated here and here by @MichaelCooper and @AdamMoore respectively , this is not possible with Forge’s authentication structure currently as it only supports api.asUser slack requests, not api.asApp slack requests.
Because of this, I have gone to great lengths attempting to do the oAuth flow myself. The plan was to manually redirect users to the slack authorization page, then use a webtrigger to take the code sent with redirectURI. This also does not work because the slack app (not the forge app) requires a static redirect URI, while the webtrigger on forge has a webhook that is generated dynamically for each install.
- Are there any good workarounds to allow slack API calls on web triggers or scheduled triggers?
- Is there some way I could extract/view the slack authentication token given using atlassian redirect uri (https://id.atlassian.com/outboundAuth/finish) when using the typical
const slack = await api.asUser().withProvider(provider, "slack-apis");
await slack.requestCredentials();
- @AtlassianDeveloper @AtlassianSupport @MichaelCooper @AdamMoore Are there any plans to make api.asApp work for making external API fetches?
Any suggestions are much appreciated! Scheduling slack messages is a must-have feature for my application.