{"_id":"passport-slack-oauth2","_rev":"9-74d304f6eb289b42ef330979f69b1b83","name":"passport-slack-oauth2","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","dist-tags":{"latest":"1.2.0","next":"1.2.0"},"versions":{"1.0.0":{"name":"passport-slack-oauth2","version":"1.0.0","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.4.0","pkginfo":"^0.4.1"},"gitHead":"94d8febc0c9f3a5aecc2326662d0fe4dd7e82e41","_id":"passport-slack-oauth2@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"dist":{"integrity":"sha512-R4hUAPzjjGfzvHGpMRhabZnlrwR9gksGikxdExHDB49NwQWhydUA/RqJg2Fmdk7cqWtYhg7IB/Umuw/E/Uj+aQ==","shasum":"04d2271200016f9d71dee6386b3a97f769f7c308","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmgvGxS8O5xecWouQQbospNtm1wwlEb1QsPdb8Q1elmgIgRZJw5FNOLms4HPvKAUyPaNKR5puuqhVMGiwIgs5KPpE="}]},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2-1.0.0.tgz_1508216876508_0.33186878194101155"},"directories":{}},"1.0.1":{"name":"passport-slack-oauth2","version":"1.0.1","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.4.0","pkginfo":"^0.4.1"},"gitHead":"10c842f790768ea53fc924243ab52b83ca6d09de","_id":"passport-slack-oauth2@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.4.0","_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"dist":{"integrity":"sha512-EYz2RARZv9R5TICq2TaJf4EVnW3pKQeOILHhHLsN0UE23wpXwpf8TvGSZmKcp0DmfCBzTkNyM2io8fgNyKJNEg==","shasum":"8444c7f08d2c1a197603fbbefa01a73744b239ac","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2E5JGJo2B3YVgy9Afkux/zoUC+z4ZX0/1IlNtVHL3YAiEAqrtkPu8nIOtAR9VIs7+WvXdvkQKr959bOXuVaGxypa0="}]},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2-1.0.1.tgz_1508217383883_0.6904081818647683"},"directories":{}},"1.0.2":{"name":"passport-slack-oauth2","version":"1.0.2","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.4.0","pkginfo":"^0.4.1"},"gitHead":"825264a69f90c93803dfdf295d5f72bf98d63cbc","_id":"passport-slack-oauth2@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.0.0","_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"dist":{"integrity":"sha512-/+SNK754aMTxGbbBtFcAQQRSuwZ+McXnJbB7qIPUFJx870YANZfVQX31gcWfMEmm6ObcFYYp1n6jbU5/XajrAQ==","shasum":"fce8032ddc330e13514114024e4f60b09d709dc7","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.0.2.tgz","fileCount":5,"unpackedSize":10935,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvbzPoB8vjwRVbFSF+pgywPHaMoum3yb3WpPj+6GFUpAIgAPP8tPWRgAUf3trUJbdvVPaj0iBAY7OD5zv47GweYCE="}]},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2_1.0.2_1518297292079_0.3007374556611111"},"_hasShrinkwrap":false},"1.1.0":{"name":"passport-slack-oauth2","version":"1.1.0","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.5.0","pkginfo":"^0.4.1"},"gitHead":"fc2a3f95c53422a0ed2abaf9427790037abd53d0","_id":"passport-slack-oauth2@1.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rd0V5lWhtNMTmDWuIIk1eXj+ANgP74fD9h28XEp6AtgtQgWPa577qfeM9YLkl7oUNn8gIQeghsvtW6ziWt52dQ==","shasum":"4a153b3d0d5a9e1a5041b61599d2b41a4b9486f1","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.1.0.tgz","fileCount":8,"unpackedSize":11933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPpYVCRA9TVsSAnZWagAAYloP+gJ/WoL+JQqmZno5Fm4U\nKOOUE1m4UxviXfRd+3541NsTeKQiGzE0ju6rQQPZ5sajIfYBBK5X1HhO63z4\nGkbWhnLDdZaEf5mCfcbwoqL/kfu6TeUddaewZDdCwpyFQI4EuF8gqlk9Ixls\nJxWH3qHzNoRW+k55+ur7AuykqaxHSptiFZWGP9ob6cge75pHNgNVfGAjTo7n\nQL4momh0aXtdrJadRv71R92ffzyqFfHKdow7a80VDBReZnyj80pJaXIk1NRo\n27h3UVmTB4YIlkmcjXEQPPGBuDaVvSr8GyUncfPf0LI2rwpSg1xHfuEB2IVX\n3qRzUh5uZE8bXHEaOkwnESJRMbMc8CNFY5kgtqX0jhpjdoOYphLup3FPaX6Q\nyehkRoWl+FLgHBZHZdqGVmPH7JvaN82bLUJ5S6cjjWUIZJV+VAizbKQ9q78p\nZBMovojKxMu9MvHTQidt12B+xOEsdGYB5cetKYHggj81GY2T9dsGWFYr4XkD\ni44T5vPregK6ZotmVF2UU1MivautVS/mk2ZJ2PNZz7x86w8h6uhwRjS92o0e\nvlb2VUObUB0OcScsYIYNGAq5bteHYv/BWKFiRuI7WTOisj+LVFLO9QRmqmLA\nnZiKnGyNtwCBwtU0J/Nq5H2H+P0ohOt1eSOtizBqza2OIn8i0ra6kD1tj+fB\nWKP3\r\n=21E5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMC77WigpVVDeB1PILnlgCf9tXrjHr04sCnc0mhlhDcAiAnmDo8AlL5CKSW5XVZCHQu3QcjoHQr9qUt8CMMarHbxA=="}]},"_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"directories":{},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2_1.1.0_1614714389515_0.7875004690287442"},"_hasShrinkwrap":false},"1.1.1":{"name":"passport-slack-oauth2","version":"1.1.1","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.5.0","pkginfo":"^0.4.1"},"gitHead":"81b366c39a65a1f93479c9d498d55b76b744249a","_id":"passport-slack-oauth2@1.1.1","_nodeVersion":"14.15.0","_npmVersion":"7.14.0","dist":{"integrity":"sha512-xC+yMKFXximP5TzSNt4lr9TP78MMos5B+acC7bJNCxBAVNyL9e02AEpVpVtyMIqHv4nNZnv1vyoOb50J8VCcZQ==","shasum":"d831ffc3f1e968fcc3622e6ecf41643c8d8f9cbc","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.1.1.tgz","fileCount":8,"unpackedSize":11955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvYLtCRA9TVsSAnZWagAAJ5IP/0WOSxI31cdF7rsru1Fw\nbovwPiJVZA5tW/pfv/VM2lcrPPjEId6WSPvOaNAR/N0RmTYVaYOABuvaOJV4\nVeiJ9NLJOL3MUOAd+CSQFa4Ik3tYy4pD3RdS1FFoZRPzCJD59zV6N7ALC3ff\nmNxaK9ZK0XGUTzmUAlGma+GaFvwV60lW6GCYnIIyGyk2K9mrdsv3DqEs1Nvj\n5x6maKIjk72231+RFr2r712p28/ScVlYexA7HfVmYAg9+PJ8JGbR5GQVCLua\n89EHhAVEI4MDr6WhlboGs71vnybfXI7g0w5G1L9/yoBm1zqsM0GwRWF7Zp/X\nDRwKB29dIlFJFbD992pqpXrmpzOz410L4DKViBKwsSL+61u8txN196vbUlks\nizkn6obGKyoKcFfr6qOQXnyZs3+sF0/EG6Ml1ZZKqy249oLfhM11LDuVQbMr\neVQ22KThFtstbI3UTxHhBVxz111HDi2NKrHGO2AjVqAgHaT6tBFhqxGnQchP\nHobfVMuj5aXO9mjCzuJojnVmbTJuR4LvfEuJkve4mjpV/77RXQI+Padd1GwR\n0sziVTxjEyRYsI1Ydy8Ks7xLsPM0soMXKMg7oL8qgTTGF/w6B7/EadOqC4KK\neaHXBUgNNqesyGyhoV1aLvvn78Apgw9EWU19s4yIZdlTMg4P4XDPJtUKS1jp\naqQ2\r\n=wrfm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk7xDrw8R4+UUJsArCED4Qb8q4WcWbz1VFvdHvJpc19QIhAJ4Yt7eNmLRjVn5K0PV7AM7LUzhQd+ZbU9Og6fpxZ+32"}]},"_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"directories":{},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2_1.1.1_1623032557228_0.4854602898624396"},"_hasShrinkwrap":false},"1.2.0-next.0":{"name":"passport-slack-oauth2","version":"1.2.0-next.0","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.7.0"},"readme":"# passport-slack-oauth2\n\n[Passport](https://github.com/jaredhanson/passport) strategy for authenticating\nwith [Slack](https://slack.com) using the OAuth 2.0 API.\n\nUpdated to support Sign in with Slack by default.\n\n[![Sign in with Slack](https://a.slack-edge.com/accd8/img/sign_in_with_slack.png)](https://api.slack.com/docs/sign-in-with-slack#identify_users_and_their_teams)\n\n## Install\n```shell\n$ npm install passport-slack-oauth2\n```\n\n## Sample Profile\n```json\n{\n    \"provider\": \"Slack\",\n    \"id\": \"U123XXXXX\",\n    \"displayName\": \"John Agan\",\n    \"user\": {\n        \"name\": \"John Agan\",\n        \"id\": \"U123XXXXX\",\n        \"email\": \"johnagan@testing.com\",\n        \"image_24\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-24.png\",\n        \"image_32\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-32.png\",\n        \"image_48\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-48.png\",\n        \"image_72\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-72.png\",\n        \"image_192\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0000-192.png\",\n        \"image_512\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0000-512.png\"\n    },\n    \"team\": {\n        \"id\": \"T123XXXX\",\n        \"name\": \"My Awesome Team\",\n        \"domain\": \"my-awesome-team\",\n        \"image_34\": \"https://a.slack-edge.com/0000/img/avatars-teams/ava_0000-00.png\",\n        \"image_44\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_68\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_88\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_102\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_132\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_230\": \"https://a.slack-edge.com/0a0a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_default\": true\n    }\n}\n\n```\n\n## Usage\n\n### Configure Strategy\n\nThe Slack authentication strategy authenticates users using a Slack\naccount and OAuth 2.0 tokens.  The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a client ID, client secret, and callback URL.\n\n```js\npassport.use(new SlackStrategy({\n    clientID: CLIENT_ID,\n    clientSecret: CLIENT_SECRET,\n    skipUserProfile: false, // default\n    scope: ['identity.basic', 'identity.email', 'identity.avatar', 'identity.team'] // default\n  },\n  (accessToken, refreshToken, profile, done) => {\n    // optionally persist user data into a database\n    done(null, profile);\n  }\n));\n```\n\n### Authenticate Requests\n\nUse `passport.authenticate()` (or `passport.authorize()` if you want to authenticate with Slack and **NOT** affect `req.user` and user session), specifying the `'slack'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get('/auth/slack', passport.authorize('Slack'));\n\napp.get('/auth/slack/callback',\n  passport.authenticate('Slack', { failureRedirect: '/login' }),\n  (req, res) => res.redirect('/') // Successful authentication, redirect home.\n);\n```\n\n### Custom Scopes\nBy default passport-slack strategy will try to retrieve [all user identity](https://api.slack.com/methods/users.identity) from Slack using the default scopes of `identity.basic`, `identity.email`, `identity.avatar`, and `identity.team`. To override these, set the `scope` parameter to an array of scopes.\n\n```js\npassport.use(new SlackStrategy({\n\tclientID: CLIENT_ID,\n\tclientSecret: CLIENT_SECRET,\n\tscope: ['identity.basic', 'channels:read', 'chat:write:user']\n}, () => { });\n```\n\n### Ignore Profile Info\nIf you just need an access token and not user profile data, you can avoid getting profile info by setting `skipUserProfile` to true.\n```js\npassport.use(new SlackStrategy({\n\tclientID: CLIENT_ID,\n\tclientSecret: CLIENT_SECRET,\n\tscope: ['incoming-webhook'],\n\tskipUserProfile: true\n}, () => { });\n```\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)","readmeFilename":"README.md","gitHead":"db04e0ea4dbc6ed0549294832bb5c9a7c6f46164","_id":"passport-slack-oauth2@1.2.0-next.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-HtvxZ8hXeJmwrNogg7h8GGs1RRYInoYqDgTFYGVlbzhlbGq0T3TILnxzaRXa4of240RLK1KanR40o+C8gAOlow==","shasum":"7a9c5f62811eabb42b73567723f9be427c38171b","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.2.0-next.0.tgz","fileCount":8,"unpackedSize":12207,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG96n0y8vatyzPvSp8FJOQtkQryVnJDZLkrnmeAUUcXeAiAv1RsBTlI56vNhdmsSR37TFcQprqnbNsUUT4VF1Yy8ZA=="}]},"_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"directories":{},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2_1.2.0-next.0_1683581976585_0.2801946486119662"},"_hasShrinkwrap":false},"1.2.0":{"name":"passport-slack-oauth2","version":"1.2.0","description":"[Passport](https://github.com/jaredhanson/passport) strategy for authenticating with [Slack](https://slack.com) using the OAuth 2.0 API.","keywords":["passport","slack","oauth2","auth","authentication","identity"],"main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","dependencies":{"passport-oauth2":"^1.7.0"},"readme":"# passport-slack-oauth2\n\n[Passport](https://github.com/jaredhanson/passport) strategy for authenticating\nwith [Slack](https://slack.com) using the OAuth 2.0 API.\n\nUpdated to support Sign in with Slack by default.\n\n[![Sign in with Slack](https://a.slack-edge.com/accd8/img/sign_in_with_slack.png)](https://api.slack.com/docs/sign-in-with-slack#identify_users_and_their_teams)\n\n## Install\n```shell\n$ npm install passport-slack-oauth2\n```\n\n## Sample Profile\n```json\n{\n    \"provider\": \"Slack\",\n    \"id\": \"U123XXXXX\",\n    \"displayName\": \"John Agan\",\n    \"user\": {\n        \"name\": \"John Agan\",\n        \"id\": \"U123XXXXX\",\n        \"email\": \"johnagan@testing.com\",\n        \"image_24\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-24.png\",\n        \"image_32\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-32.png\",\n        \"image_48\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-48.png\",\n        \"image_72\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0000-72.png\",\n        \"image_192\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0000-192.png\",\n        \"image_512\": \"https://secure.gravatar.com/avatar/123abcd123bc12b3c.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0000-512.png\"\n    },\n    \"team\": {\n        \"id\": \"T123XXXX\",\n        \"name\": \"My Awesome Team\",\n        \"domain\": \"my-awesome-team\",\n        \"image_34\": \"https://a.slack-edge.com/0000/img/avatars-teams/ava_0000-00.png\",\n        \"image_44\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_68\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_88\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-00.png\",\n        \"image_102\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_132\": \"https://a.slack-edge.com/00a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_230\": \"https://a.slack-edge.com/0a0a0/img/avatars-teams/ava_0000-000.png\",\n        \"image_default\": true\n    }\n}\n\n```\n\n## Usage\n\n### Configure Strategy\n\nThe Slack authentication strategy authenticates users using a Slack\naccount and OAuth 2.0 tokens.  The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a client ID, client secret, and callback URL.\n\n```js\npassport.use(new SlackStrategy({\n    clientID: CLIENT_ID,\n    clientSecret: CLIENT_SECRET,\n    skipUserProfile: false, // default\n    scope: ['identity.basic', 'identity.email', 'identity.avatar', 'identity.team'] // default\n  },\n  (accessToken, refreshToken, profile, done) => {\n    // optionally persist user data into a database\n    done(null, profile);\n  }\n));\n```\n\n### Authenticate Requests\n\nUse `passport.authenticate()` (or `passport.authorize()` if you want to authenticate with Slack and **NOT** affect `req.user` and user session), specifying the `'slack'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get('/auth/slack', passport.authorize('Slack'));\n\napp.get('/auth/slack/callback',\n  passport.authenticate('Slack', { failureRedirect: '/login' }),\n  (req, res) => res.redirect('/') // Successful authentication, redirect home.\n);\n```\n\n### Custom Scopes\nBy default passport-slack strategy will try to retrieve [all user identity](https://api.slack.com/methods/users.identity) from Slack using the default scopes of `identity.basic`, `identity.email`, `identity.avatar`, and `identity.team`. To override these, set the `scope` parameter to an array of scopes.\n\n```js\npassport.use(new SlackStrategy({\n\tclientID: CLIENT_ID,\n\tclientSecret: CLIENT_SECRET,\n\tscope: ['identity.basic', 'channels:read', 'chat:write:user']\n}, () => { });\n```\n\n### Ignore Profile Info\nIf you just need an access token and not user profile data, you can avoid getting profile info by setting `skipUserProfile` to true.\n```js\npassport.use(new SlackStrategy({\n\tclientID: CLIENT_ID,\n\tclientSecret: CLIENT_SECRET,\n\tscope: ['incoming-webhook'],\n\tskipUserProfile: true\n}, () => { });\n```\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)","readmeFilename":"README.md","gitHead":"fe4b918ce5f6b72dbf8d1c37a44b65bcc350190c","_id":"passport-slack-oauth2@1.2.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-SeQl8uPoi4ajhzgIvwQM7gW/6yPrKH0hPFjxcP/426SOZ0M9ZNDOfSa32q3NTw7KcwYOTjyWX/2xdJndQE7Rkg==","shasum":"d214a698b55a137393636a26827747f6c436dab4","tarball":"https://registry.npmjs.org/passport-slack-oauth2/-/passport-slack-oauth2-1.2.0.tgz","fileCount":8,"unpackedSize":12200,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClqyDh9MrTt5gotuK4DEeQxLBUlVH5gbPdt2O2/YDNQgIhAOa1vIG+CvGiMFh6oOYv5G/6TVQeQZ/dxyEwAY7nMBXB"}]},"_npmUser":{"name":"nmaves","email":"nathan.maves@gmail.com"},"directories":{},"maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-slack-oauth2_1.2.0_1686528768098_0.29879681475259323"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"nmaves","email":"nathan.maves@gmail.com"}],"time":{"modified":"2023-06-12T00:21:42.490Z","created":"2017-10-17T05:07:57.443Z","1.0.0":"2017-10-17T05:07:57.443Z","1.0.1":"2017-10-17T05:16:24.795Z","1.0.2":"2018-02-10T21:14:52.784Z","1.1.0":"2021-03-02T19:46:29.683Z","1.1.1":"2021-06-07T02:22:37.362Z","1.2.0-next.0":"2023-05-08T21:39:36.773Z","1.2.0":"2023-06-12T00:12:48.304Z"},"homepage":"https://github.com/nmaves/passport-slack-oauth2#readme","keywords":["passport","slack","oauth2","auth","authentication","identity"],"repository":{"type":"git","url":"git+https://github.com/nmaves/passport-slack-oauth2.git"},"author":{"name":"Nathan Maves","email":"nathan.maves@gmail.com"},"bugs":{"url":"https://github.com/nmaves/passport-slack-oauth2/issues"},"readmeFilename":""}