slackapi/bolt-js

User scope not working in OAuth

jacklein opened this issue · 3 comments

Hi, previously I just had bot scopes and my OAuth flow worked fine. Now I am trying to add the admin user scope to the OAuth flow and it's not working. When I go to my /slack/install endpoint, it doesn't list the admin user scope and doesn't store the scope in the database. I've added the new scope to the 'OAuth and Permissions' part of my app workspace, and the user authenticating the app is an admin of the Slack workspace.

My code looks something like:

const app = new App({
  installerOptions: {
    userScopes: ['admin']
    ...
  },
  signingSecret: ...,
  clientId: ...,
  clientSecret: ...,
  stateSecret: ...,
  scopes: ...,
  installationStore: {
   storeInstallation: ...,
   fetchInstallation: ...
  }
});

Reproducible in:

The Slack SDK version

^3.17.1

Node.js runtime version

v20.11.0

Requirements

For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Hi @jacklein - Confirming, is your user in Slack a workspace admin?

Edit: Oop reread your post, the installer is an admin. Let me see if can quickly try repro-ing!

Woah! Just realized I am accidentally passing installerOptions object twice into the App instantiation, so I think it was getting overwritten. 🙈 Sorry and thank you @srajiang

@jacklein - Thanks for writing back with what fixed it for you! I was having an issue repro-ing the behavior myself, and then the weekend hit like a ton of bricks.