This package was forked from passport-slack and updated for slack v2 of oauth.
passport-slack-v2
Passport strategy for authenticating with Slack using the OAuth 2.0 API version 2.
Updated to support Add to Slack by default.
Install
$ npm install passport-slack-v2
Express Example
const CLIENT_ID CLIENT_SECRET PORT = processenv SlackStrategy = Strategy passport = express = app = ; // setup the strategy using defaults passport; app;app; // path to start the OAuth flowapp; // OAuth callback urlapp; app;
Sample Profile
Usage
Configure Strategy
The Slack authentication strategy authenticates users using a Slack
account and OAuth 2.0 tokens. The strategy requires a verify
callback, which
accepts these credentials and calls done
providing a user, as well as
options
specifying a client ID, client secret, and callback URL.
passport;
Authenticate Requests
Use passport.authorize()
(or passport.authenticate()
if you want to authenticate with Slack and affect req.user
and user session), specifying the 'slack'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app; app;
Custom Scopes
By default passport-slack-v2 strategy will have no slack scopes. To override these, set the scope
parameter to an array of scopes.
passport
Ignore Profile Info
If you just need an access token and not user profile data, you can avoid getting profile info by setting skipUserProfile
to true.
passport
Thanks
- Noah Bragg This package was forked from passport-slack
License
Copyright (c) 2020 Noah Bragg