passport-slack
passport-slack copied to clipboard
Force team auth
Other similar Slack passport libraries allow passing a teamName
to the SlackStrategy config to make sure users can only authenticate through a specific team.
Is this possible through this library? I don't see it anywhere in documentation and have tried using teamName
and slackTeam
in the config but it does not work.
@Apexal I'm not sure if I understand you correctly. But this package allows you to pass team
in options https://github.com/mjpearson/passport-slack/blob/master/lib/passport-slack/strategy.js#L125
passport.use('slack-team', new SlackStrategy(...))
// and then
passport.authenticate('slack-team', {
team: '<team_id>',
...other params
})(req, res, next)
as described here https://api.slack.com/docs/oauth#how_the_team_parameter_behaves
So that parameter seems to attempt to authenticate a user in that workspace, but does not necessarily force it? @jsarafajr
@jsarafajr @Apexal Has this been resolved and if so can we post a quick answer in here? I am also having trouble finding documentation about restricting login to a given team/workspace only.
@mikemfleming you can use team
query parameter. This strategy simply passes that parameter to authorization url. For more information see link to Slack documentation I dropped above.