{"_id":"@afermon/passport-microsoft","_rev":"2-3d7ee3694f5d568fa26c12029b6646f1","name":"@afermon/passport-microsoft","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@afermon/passport-microsoft","version":"0.2.0","description":"Microsoft [Graph] authentication strategy for Passport.","keywords":["passport","microsoft","graph","graph.microsoft.io","oauth","oauth 2.0","auth","api","authentication","sean fisher","seafish.io"],"repository":{"type":"git","url":"git://github.com/afermon/passport-microsoft.git"},"author":{"name":"Sean Fisher","email":"opensource@seafish.io","url":"https://seafish.io"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib/","dependencies":{"pkginfo":"0.4.1","passport-oauth2":"1.6.1"},"engines":{"node":">= 12.0.0"},"gitHead":"2e86fe50300bd8918f6300fa6468187dbd6e4cf0","bugs":{"url":"https://github.com/afermon/passport-microsoft/issues"},"homepage":"https://github.com/afermon/passport-microsoft#readme","_id":"@afermon/passport-microsoft@0.2.0","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-LEhvgYHEZcpPgCN7ODnk7NqRwFho/JW4mc2V9ogbdpmZGIYhcnkeOhqPYERtC9YCeztItakTvbZCHMqLRhaTNw==","shasum":"8225280b0320aa14e6733e486ab58dc152fd5bab","tarball":"https://registry.npmjs.org/@afermon/passport-microsoft/-/passport-microsoft-0.2.0.tgz","fileCount":5,"unpackedSize":8614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4QZgCRA9TVsSAnZWagAABnAP/iLyqasWiIWMX+OtCwjY\nIcoE2J6QfDrwuIiZIEMp7GJK05Be9e7mFPyJ2M/unNXJOJ5n8NE1zJZ2qQmV\nqI+x/9i7Byp7EpTaUvGBJNsDpDc3rFAGdJT6HNsZqQ9J3cM/6I0TmvGwfldH\nf93CYXuR+VGtrqXYqKxPgp6cGaL5kCA/QSEW0kkKh88REO9IWgPgQrHiYJXE\nyRcmgBLzsCXxYRs/KomqyxeegHSbhqCtyGs0pnV8MV0C6c0mMDG0A8ZQDqB4\nzam71KwocRX2ISct7Lw9/TZLkbl3+UXenNmp6ftvZ7lHekjuxm1aVjRim+XR\nHREvyLPSiEnQC8d0wlsOgc6WGu+FUakhTwlOIj7fpSwpeW4doztKBihF9hkw\nn3mdAtMi5dwIinDEg5DBv9jpY39wXAIw2shTNMH4TTWF2zXmN53Net2k0sax\nBV0WkpjuFS0RkDKMLtbh4Mrs1QV5FWWwgOFlIYqv9gXvEo4yVrP+bL67TcvX\nKSGdZEudj+ObXQQgSJq7DCX9O51Wk8+i1G25leOfuJySqsY+l80HhsJZe1YT\nn56X3v0VQqNRErXQwV/vfb3hCFxil89TZVroLeEQmAuEJdHxyVU25U0ggmjY\nZsSeGsC7VeB8jSietAQwDhkMIk2KWge5HBdvBEYM9BpIaBYkgZvDVNj/FcFf\nDm98\r\n=Q7p8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFjc6j68x241cNev9dyLGnlTp92aMLvyPHSgenQSIcaqAiEAmF03fo9+mv26egGuzUuEFalL3Cw1ILxPjuM3CvmV29o="}]},"_npmUser":{"name":"afermon","email":"alex@xicre.com"},"directories":{},"maintainers":[{"name":"afermon","email":"alex@xicre.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-microsoft_0.2.0_1642137184029_0.9346666982677634"},"_hasShrinkwrap":false},"0.2.1":{"name":"@afermon/passport-microsoft","version":"0.2.1","description":"Microsoft [Graph] authentication strategy for Passport.","keywords":["passport","microsoft","graph","graph.microsoft.io","oauth","oauth 2.0","auth","api","authentication","sean fisher","seafish.io"],"repository":{"type":"git","url":"git://github.com/afermon/passport-microsoft.git"},"author":{"name":"Sean Fisher","email":"opensource@seafish.io","url":"https://seafish.io"},"license":"MIT","main":"./lib/","dependencies":{"pkginfo":"0.4.1","passport-oauth2":"1.6.1"},"engines":{"node":">= 12.0.0"},"gitHead":"2e86fe50300bd8918f6300fa6468187dbd6e4cf0","bugs":{"url":"https://github.com/afermon/passport-microsoft/issues"},"homepage":"https://github.com/afermon/passport-microsoft#readme","_id":"@afermon/passport-microsoft@0.2.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-ymkNpCCPpgJXylrbhMhfR2kCfJo6TnrgzNvEO4wfEOTm5mHkQw6AcrIiBbQZ9SPf4W50gV0qQ+9Q3oPNIOd8JQ==","shasum":"3bf3c7501723d9b83dade0bbfb17df64e60fe783","tarball":"https://registry.npmjs.org/@afermon/passport-microsoft/-/passport-microsoft-0.2.1.tgz","fileCount":5,"unpackedSize":8526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4Qe7CRA9TVsSAnZWagAAe4AP/1Ejah0d8oouarYMkuDJ\nFE0+ggRrRNvZahwXBZuCUWJIWpLjSDiK416nuQAUfDCB1iG1F4E2MJ29vSLZ\nckyCGNLDKHbvU+AcZC5d83ut6+UDASrS3O4q6LD75LUzxUpVE74P14b3A+EO\nO3rUCqXS/+Ko/iFaHumqlds0GL0jPnoX0xEBY1mvOh662I4aHjtrKCctZnZ8\neaEGC89UC6rRqkl3gRTvK1lKbyzK4BXhFNG8D/Qg9VMtam7XBHlSt5KhZl/h\nXQGn5/GeebFFf7E49uKbVmQaNgCTrndpsZA1LR0gM+Ek9jp9i7RyB5wMHUSF\nQNxhHWQGmC0iEh6egzXvYD7r1BxUvWAAT+5ShF7Wgf8kq1giG/R4f1If1IMi\ndXO8gsiX9raGE8EGN1ggOfX1NXY5SbwiP+8xoT/s2v9JZCQic3jgRlA8GZDu\ntQUBjQjsY/Tz1WfbWINM/mKKTdsIEVNi05w68/Dd+g2NXHFJVd2G5gu2MOq/\nn5VWzWKKkR7G0N4quVPRWDgaU6GtrjwEdrCL4/9EnSYrGK9/PNDdI5BFIHd2\nqEa8pYuoM2tyixUr6cUKi6T6whbFz10EsPLn9B6ZCeJPcLT5pfzK242Zq6ZI\nSn9qx/2f2y+V8IOkPVfQBN/MF8s5EczSZal4bhFgnPP59tXpMhnRFXIBqZ+0\nEeGl\r\n=jbHE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2Up5c99K8Lhi7fQhSosl8kl33hHeqnjiI4n41QJa1YAiBkzRxJd38xytNCZvjeVz7F0lGu4/Hwek7HSONQ5+m22Q=="}]},"_npmUser":{"name":"afermon","email":"alex@xicre.com"},"directories":{},"maintainers":[{"name":"afermon","email":"alex@xicre.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-microsoft_0.2.1_1642137531718_0.7002701602057229"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-14T05:13:03.963Z","0.2.0":"2022-01-14T05:13:04.239Z","modified":"2022-04-04T11:50:16.094Z","0.2.1":"2022-01-14T05:18:51.849Z"},"maintainers":[{"name":"afermon","email":"alex@xicre.com"}],"description":"Microsoft [Graph] authentication strategy for Passport.","homepage":"https://github.com/afermon/passport-microsoft#readme","keywords":["passport","microsoft","graph","graph.microsoft.io","oauth","oauth 2.0","auth","api","authentication","sean fisher","seafish.io"],"repository":{"type":"git","url":"git://github.com/afermon/passport-microsoft.git"},"author":{"name":"Sean Fisher","email":"opensource@seafish.io","url":"https://seafish.io"},"bugs":{"url":"https://github.com/afermon/passport-microsoft/issues"},"readme":"# Passport-microsoft\n\nFroked from [seanfisher/passport-microsoft](https://github.com/seanfisher/passport-microsoft) to update dependencies and address [Improper Access Control in passport-oauth2](https://github.com/advisories/GHSA-f794-r6xc-hf3v)\n\n[Passport](https://github.com/jaredhanson/passport) strategy for authenticating\nwith [Microsoft Graph](https://graph.microsoft.io/) using the OAuth 2.0 API.\n\nThis module lets you authenticate using Microsoft, in your Node.js applications.  \nBy plugging into Passport, Microsoft authentication can be easily and unobtrusively\nintegrated into any application or framework that supports [Connect](http://www.senchalabs.org/connect/)-style\nmiddleware, including [Express](http://expressjs.com/).\n\n## Install\n\nInstall via [npm](https://www.npmjs.com/package/passport-microsoft)\n\n    $ npm install passport-microsoft\n\n## Usage\n\n#### Configure Strategy\n\nThe microsoft authentication strategy authenticates users using a microsoft account 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\nThe consumer key and secret are obtained by [creating an application](https://apps.dev.microsoft.com/#/appList) at\nMicrosoft's developer site.\n\n```js\nvar MicrosoftStrategy = require(\"passport-microsoft\").Strategy;\npassport.use(\n  new MicrosoftStrategy(\n    {\n      clientID: \"applicationidfrommicrosoft\",\n      clientSecret: \"applicationsecretfrommicrosoft\",\n      callbackURL: \"http://localhost:3000/auth/microsoft/callback\",\n      scope: [\"user.read\"],\n    },\n    function (accessToken, refreshToken, profile, done) {\n      User.findOrCreate({ userId: profile.id }, function (err, user) {\n        return done(err, user);\n      });\n    }\n  )\n);\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'microsoft'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get(\"/auth/microsoft\", passport.authenticate(\"microsoft\"));\n\napp.get(\n  \"/auth/microsoft/callback\",\n  passport.authenticate(\"microsoft\", { failureRedirect: \"/login\" }),\n  function (req, res) {\n    // Successful authentication, redirect home.\n    res.redirect(\"/\");\n  }\n);\n```\n\n## Examples\n\nFor a complete, working example, refer to the [login example](https://github.com/seanfisher/passport-microsoft/tree/master/example/login).\n\n## Credits\n\n- [Sean Fisher](https://www.seafish.io) - [passport-microsoft on Github](https://github.com/seanfisher/passport-microsoft)\n- [Sluggy Bear](http://github.com/slugbay) - Original [Microsoft OneDrive](https://github.com/slugbay/passport-onedrive) strategy, upon which this is based\n\nCopyright (c) 2020 Sean Fisher <[seafish.io](https://www.seafish.io)>\n\n## Thanks\n\n- [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n- [The MIT License](http://opensource.org/licenses/MIT)\n","readmeFilename":"README.md","license":"MIT"}