无法通过护照松弛向松弛认证

时间:2020-05-29 07:21:17

标签: passport.js slack

我正在使用passport-slack实现“松弛身份验证”。我只想使用incoming-webhook。我已经设置了“ incoming-webhook”,但出现以下错误:

请求了未批​​准的权限 入网钩

代码:

const SlackStrategy = require('passport-slack').Strategy
passport.use(
  new SlackStrategy(
    {
      clientID: config.slack.client_id,
      clientSecret: config.slack.client_secret,
      scope: ['incoming-webhook'],
      skipUserProfile: true   
    },
    (req, profile, done) => {
        // slack data
    }
   )
)

1 个答案:

答案 0 :(得分:0)

我需要在这里设置范围。

app.get('/auth/slack', (req, res, next) => {
  passport.authenticate('slack', { scope: 'incoming-webhook' })(req, res, next)
})