Requesting only user scopes with @slack/oauth fails with stateSecret invalid even when it is valid.
[ERROR] OAuth:InstallProvider:0 Error: The response from the authorization URL contained inconsistent information. Please file a bug.
at InstallProvider.<anonymous> (MYPROJECT/node_modules/@slack/oauth/dist/index.js:333:27)
at step (MYPROJECT/node_modules/@slack/oauth/dist/index.js:44:23)
at Object.next (MYPROJECT/node_modules/@slack/oauth/dist/index.js:25:53)
at fulfilled (MYPROJECT/node_modules/@slack/oauth/dist/index.js:16:58)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
This fails (I tried everything here, even implementing my own state store before finding this bug)
server.get('/', async (req, res) => {
const url = await installer.generateInstallUrl({
scopes: [ ],
userScopes: ['channels:history', 'groups:history', 'mpim:history', 'im:history', 'chat:write'],
})
res.redirect(url)
})
while this succeeds
server.get('/', async (req, res) => {
const url = await installer.generateInstallUrl({
scopes: ["chat:write"],
userScopes: ['channels:history', 'groups:history', 'mpim:history', 'im:history', 'chat:write'],
})
res.redirect(url)
})
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
Select all that apply:
@slack/web-api@slack/events-api@slack/interactive-messages@slack/rtm-api@slack/webhooks@slack/oauthpackage version: ^2.0.0
node version: v15.0.1
OS version(s): macOS 11.1
@slack/oauth code and request only user scopesAuthorisation succeeds
[ERROR] OAuth:InstallProvider:0 Error: The response from the authorization URL contained inconsistent information. Please file a bug.
at InstallProvider.<anonymous> (MYPROJECT/node_modules/@slack/oauth/dist/index.js:333:27)
at step (MYPROJECT/node_modules/@slack/oauth/dist/index.js:44:23)
at Object.next (MYPROJECT/node_modules/@slack/oauth/dist/index.js:25:53)
at fulfilled (MYPROJECT/node_modules/@slack/oauth/dist/index.js:16:58)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Thanks for submitting this! I sent a fix in. Will do a release on Monday which includes it.
Most helpful comment
Thanks for submitting this! I sent a fix in. Will do a release on Monday which includes it.