{"_id":"@dmapper/passport-oauth2","_rev":"7-83e447b21f182aa406b806045c53b3d2","name":"@dmapper/passport-oauth2","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dmapper/passport-oauth2","version":"1.0.0","keywords":["passport","auth","authn","authentication","authz","authorization","oauth","oauth2"],"author":{"url":"http://www.jaredhanson.net/","name":"Jared Hanson","email":"jaredhanson@gmail.com"},"license":"MIT","_id":"@dmapper/passport-oauth2@1.0.0","maintainers":[{"name":"asie15","email":"kz.asie.zk@mail.ru"},{"name":"anagami","email":"anagami.by@gmail.com"},{"name":"vibranovskym","email":"vibranovsky.m.i314@gmail.com"},{"name":"vinoron","email":"vinoron@yandex.ru"},{"name":"nariman322","email":"nariknarik322@gmail.com"},{"name":"zag2art","email":"zag2art@gmail.com"},{"name":"vmakhaev","email":"vmakhaev@gmail.com"},{"name":"yska","email":"pturchik@yandex.ru"},{"name":"cray0000","email":"cray0000@gmail.com"},{"name":"maestro.sc","email":"maestro.simf@gmail.com"},{"name":"fctsvirus","email":"fctsvirus0k@gmail.com"},{"name":"tarlord","email":"evgeniy.tarl@gmail.com"},{"name":"goonyaa","email":"gary.malakhov+npmjs.com@gmail.com"},{"name":"diesel457","email":"dimarakov21@gmail.com"},{"name":"dewens","email":"ivanchenkodenis@gmail.com"},{"name":"rabbit-abyss","email":"rabbit.abyss.kv@gmail.com"},{"name":"ovvn","email":"omazinov@gmail.com"},{"name":"dm-deploys","email":"admin@decisionmapper.com"},{"name":"astranomus","email":"timofey.korjakin@gmail.com"},{"name":"byshock","email":"ivan.lepkin@yandex.ru"},{"name":"frenz1e","email":"vitaliydus@gmail.com"},{"name":"zheoreh","email":"zhe-o@yandex.ru"},{"name":"maugliwork","email":"maugliwork@gmail.com"},{"name":"kondrashov98","email":"bona.kiev@gmail.com"},{"name":"ice9k","email":"hyd3@yandex.ru"},{"name":"olvipi","email":"ovpischuk@gmail.com"},{"name":"katamoritoka","email":"katamoritoka@gmail.com"}],"homepage":"https://github.com/zheoreh/passport-oauth2#readme","bugs":{"url":"http://github.com/zheoreh/passport-oauth2/issues"},"dist":{"shasum":"65a8b2d188d9822c6314a324c74b8d1c758a40df","tarball":"https://registry.npmjs.org/@dmapper/passport-oauth2/-/passport-oauth2-1.0.0.tgz","fileCount":21,"integrity":"sha512-OJrIVNL3G8cpAbhm1a6+Bl+W+T6Mx1R1kcHBlhtnHO3v7IDptR0oapjiX5EZn7TJstBD3E5fGrgeAozqvSgnww==","signatures":[{"sig":"MEQCIECXfPP4UhyYT2ORUSQJqqGpkRSlTz7ooEPpQgOJsuguAiBYYXY7fqJEF4+4MwxdjJnPU9CFr2rG8nZ7bRLBGO6r4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38605,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8S60ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqm5g//QCPS0ZtbM3tR05AA3xVmsjUzvvd/As0BJgpaqgQF3fJo9dGt\r\n2B3CKmQ79s2ECFAzMTcVVSHACqxw1TYZifp/8+f3v6mGSwuAy3M8htVT0OYO\r\nAt7LsyEzDcjfTC8cAh0rwdjXl9pvlKqfngtMCRapE8jsO92OErhj7+SrvLL+\r\nT/h9nVI++T4A5Suv+bm+30v7JT3eFjo+SB2Mxw2WtvALXAWmvmRwS7ZiPjMP\r\nXbigh6zlSKA82ZMVyLin+XWgL1uJ7z80liDcEiS4vb6HP7ThFktlZOhcXuI5\r\nOdNdUSHB7Z2iH7S4Gykc2VbcnIBZfPYp9NDIConQjKpztxCTimZgZREU2poZ\r\njaql880Cop0/zi2q63Y6vJu4No+2H4zzDznZxcijMRPNug/lkPM3F9jSbNRM\r\nBb0iKEWyFtPLuqwNhhMnWl9fA4EaHs6KRik+2m4PLQaH/0PV9YtWR+Sknz6P\r\nOQe7knLaZao5+vEXK/4VSc8MVOUp8L7/ItUq8+ojKud0VtR5tqeuqDaST0xx\r\n8HBV0Slp+c0meAAzUOGWPl3r5dvCzqdaa4HblsN+Y7lDBCK3931GEOFPQIIV\r\nyBoEy2sbTQeDfrBeGpUSgQExAhiWPp+/A6lBKhl6tlPcPOVQ9G96WFeBzYQ1\r\n6WULiUiO21+u1DO0kKioIOFjNvYlFQUn3GA=\r\n=8QDJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib","engines":{"node":">= 0.4.0"},"gitHead":"253007b2579ac02df5004ed002030474e2055974","scripts":{"test":"mocha --reporter spec --require test/bootstrap/node test/*.test.js test/**/*.test.js"},"_npmUser":{"name":"dm-deploys","email":"admin@decisionmapper.com"},"licenses":[{"url":"http://opensource.org/licenses/MIT","type":"MIT"}],"repository":{"url":"git://github.com/zheoreh/passport-oauth2.git","type":"git"},"_npmVersion":"8.5.5","description":"OAuth 2.0 authentication strategy for Passport.","directories":{},"_nodeVersion":"16.15.0","dependencies":{"uid2":"0.0.x","oauth":"0.9.x","base64url":"3.x.x","utils-merge":"1.x.x","passport-strategy":"1.x.x"},"_hasShrinkwrap":false,"devDependencies":{"chai":"2.x.x","mocha":"2.x.x","make-node":"0.4.6","proxyquire":"0.6.x","chai-passport-strategy":"1.x.x"},"_npmOperationalInternal":{"tmp":"tmp/passport-oauth2_1.0.0_1659973300767_0.12107504754160314","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-08-08T15:41:40.766Z","modified":"2026-05-01T14:28:52.039Z","1.0.0":"2022-08-08T15:41:40.941Z"},"bugs":{"url":"http://github.com/zheoreh/passport-oauth2/issues"},"author":{"url":"http://www.jaredhanson.net/","name":"Jared Hanson","email":"jaredhanson@gmail.com"},"license":"MIT","homepage":"https://github.com/zheoreh/passport-oauth2#readme","keywords":["passport","auth","authn","authentication","authz","authorization","oauth","oauth2"],"repository":{"url":"git://github.com/zheoreh/passport-oauth2.git","type":"git"},"description":"OAuth 2.0 authentication strategy for Passport.","maintainers":[{"email":"nariknarik322@gmail.com","name":"nariman322"},{"email":"zag2art@gmail.com","name":"zag2art"},{"email":"vmakhaev@gmail.com","name":"vmakhaev"},{"email":"pturchik@yandex.ru","name":"yska"},{"email":"cray0000@gmail.com","name":"cray0000"},{"email":"maestro.simf@gmail.com","name":"maestro.sc"},{"email":"fctsvirus0k@gmail.com","name":"fctsvirus"},{"email":"evgeniy.tarl@gmail.com","name":"tarlord"},{"email":"gary.malakhov+npmjs.com@gmail.com","name":"goonyaa"},{"email":"dimarakov21@gmail.com","name":"diesel457"},{"email":"ivanchenkodenis@gmail.com","name":"dewens"},{"email":"rabbit.abyss.kv@gmail.com","name":"rabbit-abyss"},{"email":"omazinov@gmail.com","name":"ovvn"},{"email":"devops@zenkoder.com","name":"dm-deploys"},{"email":"timofey.korjakin@gmail.com","name":"astranomus"},{"email":"ivan.lepkin@yandex.ru","name":"byshock"},{"email":"vitaliydus@gmail.com","name":"frenz1e"},{"email":"zhe-o@yandex.ru","name":"zheoreh"},{"email":"maugliwork@gmail.com","name":"maugliwork"},{"email":"bona.kiev@gmail.com","name":"kondrashov98"},{"email":"babaev.raphael@gmail.com","name":"ice9k"},{"email":"ovpischuk@gmail.com","name":"olvipi"},{"email":"vibranovsky.m.i314@gmail.com","name":"vibranovskym"},{"email":"vinoron@yandex.ru","name":"vinoron"},{"email":"anagami.by@gmail.com","name":"anagami"},{"email":"ablaev.r.s@gmail.com","name":"rustem-as"},{"email":"nbhim12@gmail.com","name":"nbhim12"},{"email":"gdancerx@gmail.com","name":"gdancerx"}],"readme":"# passport-oauth2\n\nThis fork implements optional callback function that can be used to pass client id and secret \nto initialise oauth2 each time directly before an authentication. This function is called \nwith the request object.\n\n```js\npassport.use(new OAuth2Strategy({\n    authorizationURL: 'https://www.example.com/oauth2/authorize',\n    tokenURL: 'https://www.example.com/oauth2/token',\n    getClient: async function(req) {\n      // some possible async operations\n      // ...\n      return {\n        id: '#####',\n        secret: '#####'\n      }\n    },\n    callbackURL: \"http://localhost:3000/auth/example/callback\"\n  },\n  function(accessToken, refreshToken, profile, cb) {\n    User.findOrCreate({ exampleId: profile.id }, function (err, user) {\n      return cb(err, user);\n    });\n  }\n));\n```\n====================================================================================\n\nGeneral-purpose OAuth 2.0 authentication strategy for [Passport](http://passportjs.org/).\n\nThis module lets you authenticate using OAuth 2.0 in your Node.js applications.\nBy plugging into Passport, OAuth 2.0 authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/).\n\nNote that this strategy provides generic OAuth 2.0 support.  In many cases, a\nprovider-specific strategy can be used instead, which cuts down on unnecessary\nconfiguration, and accommodates any provider-specific quirks.  See the\n[list](https://github.com/jaredhanson/passport/wiki/Strategies) for supported\nproviders.\n\nDevelopers who need to implement authentication against an OAuth 2.0 provider\nthat is not already supported are encouraged to sub-class this strategy.  If you\nchoose to open source the new provider-specific strategy, please add it to the\nlist so other people can find it.\n\n---\n\n<p align=\"center\">\n  <sup>Advertisement</sup>\n  <br>\n  <a href=\"https://click.linksynergy.com/link?id=D*o7yui4/NM&offerid=507388.380582&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Flearn-oauth-2%2F&u1=5I2riUEiNIRjPjdjxj6X4exzu3lhRkWY0et6Y8eyT3\">Learn OAuth 2.0 - Get started as an API Security Expert</a><br>Just imagine what could happen to YOUR professional career if you had skills in OAuth > 8500 satisfied students\n</p>\n\n---\n\n[![npm](https://img.shields.io/npm/v/passport-oauth2.svg)](https://www.npmjs.com/package/passport-oauth2)\n[![build](https://img.shields.io/travis/jaredhanson/passport-oauth2.svg)](https://travis-ci.org/jaredhanson/passport-oauth2)\n[![coverage](https://img.shields.io/coveralls/jaredhanson/passport-oauth2.svg)](https://coveralls.io/github/jaredhanson/passport-oauth2)\n[...](https://github.com/jaredhanson/passport-oauth2/wiki/Status)\n\n## Install\n\n    $ npm install passport-oauth2\n\n## Usage\n\n#### Configure Strategy\n\nThe OAuth 2.0 authentication strategy authenticates users using a third-party\naccount and OAuth 2.0 tokens.  The provider's OAuth 2.0 endpoints, as well as\nthe client identifer and secret, are specified as options.  The strategy\nrequires a `verify` callback, which receives an access token and profile,\nand calls `cb` providing a user.\n\n```js\npassport.use(new OAuth2Strategy({\n    authorizationURL: 'https://www.example.com/oauth2/authorize',\n    tokenURL: 'https://www.example.com/oauth2/token',\n    clientID: EXAMPLE_CLIENT_ID,\n    clientSecret: EXAMPLE_CLIENT_SECRET,\n    callbackURL: \"http://localhost:3000/auth/example/callback\"\n  },\n  function(accessToken, refreshToken, profile, cb) {\n    User.findOrCreate({ exampleId: profile.id }, function (err, user) {\n      return cb(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'oauth2'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```js\napp.get('/auth/example',\n  passport.authenticate('oauth2'));\n\napp.get('/auth/example/callback',\n  passport.authenticate('oauth2', { failureRedirect: '/login' }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\n```\n\n## Related Modules\n\n- [passport-oauth1](https://github.com/jaredhanson/passport-oauth1) — OAuth 1.0 authentication strategy\n- [passport-http-bearer](https://github.com/jaredhanson/passport-http-bearer) — Bearer token authentication strategy for APIs\n- [OAuth2orize](https://github.com/jaredhanson/oauth2orize) — OAuth 2.0 authorization server toolkit\n\n## Contributing\n\n#### Tests\n\nThe test suite is located in the `test/` directory.  All new features are\nexpected to have corresponding test cases.  Ensure that the complete test suite\npasses by executing:\n\n```bash\n$ make test\n```\n\n#### Coverage\n\nAll new feature development is expected to have test coverage.  Patches that\nincrese test coverage are happily accepted.  Coverage reports can be viewed by\nexecuting:\n\n```bash\n$ make test-cov\n$ make view-cov\n```\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2016 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n\n\n","readmeFilename":"README.md"}