slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
151 stars 27 forks source link

[QUERY] Can't add secret key to local environment #328

Closed markfoden closed 1 month ago

markfoden commented 1 month ago

I've just created a new instance of a Slack app using exactly the same code as another instance.

I followed the steps in the External Auth page to set up the external authentication.

Initially when I ran slack external-auth add-secret for both Deployed and Local environments I got a "No OAuth2 providers" error.

After about 20 minutes I tried the command again for the Deployed environment and it worked. I was then able to deploy the app with no errors.

I've since tried several times to run slack external-auth add-secret for the Local environment but continue to get the "No OAuth2 providers" error.

Slack Doctor shows no issues.

I've created new instances in this way several times and not had this issue before.

There are new files to do with a Docker container in the app - could it be to do with this?

Grateful for help. Thanks.

srajiang commented 1 month ago

Hi @markfoden! Thanks for writing in, let's see if we can narrow down what the cause would be.

I've since tried several times to run slack external-auth add-secret for the Local environment but continue to get the "No OAuth2 providers" error.

Are you able to share the log outputs you see when you execute this action ☝️. You can run slack external-auth add-secret --verbose to output the verbose logging. I want to confirm what error code you're receiving, get some datapoints for possibly reproducing your error.

markfoden commented 1 month ago

@srajiang Thanks very much for looking at this. Here's the output: external-auth_verbose.txt

srajiang commented 1 month ago

Alright, so your app for some reason hasn't properly registered the Oauth2 provider.

I'm assuming you have your Provider definition file correctly setup based on the instructions, and externalAuthProviders is correctly set on your Manifest.

So what I'm wondering is whether something has happened in the installation stepp. slack deploy triggers reinstallation of deployed apps, but since your app is a local app, can we try triggering installation again by running slack run, then retrying the add secret comand?

markfoden commented 1 month ago

@srajiang That didn't work initially but I commented out the existing workflow steps that had a token as input. It then worked fine. Odd that it worked for the Deployed environment but not the Local. But all's well now. Thanks for your help.