node-slack-sdk icon indicating copy to clipboard operation
node-slack-sdk copied to clipboard

token parameter in apps.event.authorizations.list method call results in invalid_auth error

Open seratch opened this issue 2 years ago • 0 comments

If you pass an app-level token to WebClient's apps.event.authorizations.list method call, it results in invalid_auth error code. A workaround is to pass the token to WebClient constructor instead.

This fails with invalid_auth error:

const client = new WebClient();
const result = await web.apps.event.authorizations.list({
  token: 'xapp-xxx',
  event_context: 'xxx'
});

This following works:

const client = new WebClient(token);
const result = await web.apps.event.authorizations.list({
  event_context: 'xxx'
});

This behavior should be improved.

Packages:

Select all that apply:

  • [x] @slack/web-api
  • [ ] @slack/rtm-api
  • [ ] @slack/webhooks
  • [ ] @slack/oauth
  • [ ] @slack/socket-mode
  • [ ] I don't know

Reproducible in:

The Slack SDK version

any

Node.js runtime version

any

OS info

any

seratch avatar Jun 17 '22 01:06 seratch