{"_id":"passport-google-oauth20","_rev":"13-94f9e50a9948b1cd20985a71c817f676","name":"passport-google-oauth20","description":"Google (OAuth 2.0) authentication strategy for Passport.","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"passport-google-oauth20","version":"1.0.0","description":"Google (OAuth 2.0) authentication strategy for Passport.","keywords":["passport","google","auth","authn","authentication","identity"],"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-google-oauth2.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-google-oauth2/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth2":"1.x.x"},"devDependencies":{"make-node":"0.3.x","mocha":"1.x.x","chai":"2.x.x","chai-passport-strategy":"1.x.x"},"engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha --require test/bootstrap/node test/*.test.js test/**/*.test.js"},"gitHead":"b94efe85b368f0d52940949eaf304cae15ed4647","homepage":"https://github.com/jaredhanson/passport-google-oauth2#readme","_id":"passport-google-oauth20@1.0.0","_shasum":"3b960e8a1d70d1dbe794615c827c68c40392a5d0","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"dist":{"shasum":"3b960e8a1d70d1dbe794615c827c68c40392a5d0","tarball":"https://registry.npmjs.org/passport-google-oauth20/-/passport-google-oauth20-1.0.0.tgz","integrity":"sha512-asv9bVBYf0F6OBP/17dBbHq74KpKVrIQLKPpPmUoR2Wwxv9ZlmNv6QpIX2m0VPkAilLtQeWewWESsqZeh7ZSWQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyoldFqBej3krOjuSj0kN5NUNVV5YpnR4SH8XOocCnewIhAMOiXOhnDWirqVsnDdpiJjIh8qVGD6QIbnqdCTiv+JqN"}]},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/passport-google-oauth20-1.0.0.tgz_1454548271393_0.08691097632981837"},"directories":{}},"2.0.0":{"name":"passport-google-oauth20","version":"2.0.0","description":"Google (OAuth 2.0) authentication strategy for Passport.","keywords":["passport","google","auth","authn","authentication","identity"],"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-google-oauth2.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-google-oauth2/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"http://opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth2":"1.x.x"},"devDependencies":{"make-node":"0.3.x","mocha":"1.x.x","chai":"2.x.x","chai-passport-strategy":"1.x.x"},"engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha --require test/bootstrap/node test/*.test.js test/**/*.test.js"},"gitHead":"99d481fb0c05317c7731dc64df0f1b0cfe607377","homepage":"https://github.com/jaredhanson/passport-google-oauth2#readme","_id":"passport-google-oauth20@2.0.0","_shasum":"0d241b2d21ebd3dc7f2b60669ec4d587e3a674ef","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"dist":{"shasum":"0d241b2d21ebd3dc7f2b60669ec4d587e3a674ef","tarball":"https://registry.npmjs.org/passport-google-oauth20/-/passport-google-oauth20-2.0.0.tgz","integrity":"sha512-KSk6IJ15RoxuGq7D1UKK/8qKhNfzbLeLrG3gkLZ7p4A6DBCcv7xpyQwuXtWdpyR0+E0mwkpjY1VfPOhxQrKzdQ==","fileCount":13,"unpackedSize":20516,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgv1qCRA9TVsSAnZWagAA0aAQAKLyjtVditbEAjvgtl/J\nv6aSaoJZy55r6DTezMl03BbRyX4dq1Xe1hK9lXTJ/ytssVEcWdUNmDoNEUgN\nLJxiLNY7kVNwLrLzRWAE63ZYXXt0lj7e8XC/u6xf8SlI4RGtPCPXK3sd9sZ/\nEslYK4Sr248uYfvf58I49CwZm7bufFIUqHHE5LDAp1mnhPTuC557hjo0jV2/\nzxVXIkSAay5tCvkqEVRnMRxopva77kxLwcPZWzEYjBvJ9SHexhxgjICi7XkK\njXETC7ZuxbPCFMOrG2qNt8FIZumkixIs/OdYxFxR7y6x703jUuZsADkGpvAs\nLfddmrvZYHjlf9oxudXVT8dqR/2tp3To/erhdG7FGudgG6sN6qP8rNmNtz8P\ntydTrrKXd6A0GjNO4OazjTU4xpyWlY9KjXz5oT6Q+/OVC4+3d+Ngr0/SIqMG\n64qS9pdqZGKlUCCCvdrYg8eaJcmldfyUx3dDglzBcWrNT7gsYx5beZrK3I7G\nwvl4vJr209TnrLw9xkI/YAeZTNR1t9ND5Hcr9pf1e2y0vIvpPBWol5RActLY\nPRaF41sa+EqwIdnx0rA2kLEhxY/fZc5mJ1FVcCtYV7eoahIzxbqbi2hSPCM1\nwlcOYgYE8PjSfNz8ANR0YgVh5B2jnTcbXSFa/i0qc9xzdaWiNcoKyZPTG7eg\n392e\r\n=KmJU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUPA6qt4W/TPzmWz9zyD1nDq4R9mEeUSOD01vVf1En3AiEAqtVHoGzYjxVMv5Y+UiPTyyQbxYCc9cIPntRVHFGM8FA="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-google-oauth20_2.0.0_1552088425649_0.255688156634591"},"_hasShrinkwrap":false}},"readme":"# passport-google-oauth20\n\n[Passport](http://passportjs.org/) strategy for authenticating with [Google](http://www.google.com/)\nusing the OAuth 2.0 API.\n\nThis module lets you authenticate using Google in your Node.js applications.\nBy plugging into Passport, Google 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\n---\n\n<p align=\"center\"><a href=\"http://www.tkqlhce.com/click-8907558-13433666\" target=\"_top\">1Password, the only password manager you should trust.</a> Industry-leading security and award winning design.</p>\n\n---\n\nStatus:\n[![Build](https://img.shields.io/travis/jaredhanson/passport-google-oauth2.svg)](https://travis-ci.org/jaredhanson/passport-google-oauth2)\n[![Coverage](https://img.shields.io/coveralls/jaredhanson/passport-google-oauth2.svg)](https://coveralls.io/r/jaredhanson/passport-google-oauth2)\n[![Quality](https://img.shields.io/codeclimate/github/jaredhanson/passport-google-oauth2.svg?label=quality)](https://codeclimate.com/github/jaredhanson/passport-google-oauth2)\n[![Dependencies](https://img.shields.io/david/jaredhanson/passport-google-oauth2.svg)](https://david-dm.org/jaredhanson/passport-google-oauth2)\n\n\n## Install\n\n```bash\n$ npm install passport-google-oauth20\n```\n\n## Usage\n\n#### Create an Application\n\nBefore using `passport-google-oauth20`, you must register an application with\nGoogle.  If you have not already done so, a new project can be created in the\n[Google Developers Console](https://console.developers.google.com/).\nYour application will be issued a client ID and client secret, which need to be\nprovided to the strategy.  You will also need to configure a redirect URI which\nmatches the route in your application.\n\n#### Configure Strategy\n\nThe Google authentication strategy authenticates users using a Google account\nand OAuth 2.0 tokens.  The client ID and secret obtained when creating an\napplication are supplied as options when creating the strategy.  The strategy\nalso requires a `verify` callback, which receives the access token and optional\nrefresh token, as well as `profile` which contains the authenticated user's\nGoogle profile.  The `verify` callback must call `cb` providing a user to\ncomplete authentication.\n\n```javascript\nvar GoogleStrategy = require('passport-google-oauth20').Strategy;\n\npassport.use(new GoogleStrategy({\n    clientID: GOOGLE_CLIENT_ID,\n    clientSecret: GOOGLE_CLIENT_SECRET,\n    callbackURL: \"http://www.example.com/auth/google/callback\"\n  },\n  function(accessToken, refreshToken, profile, cb) {\n    User.findOrCreate({ googleId: profile.id }, function (err, user) {\n      return cb(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'google'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```javascript\napp.get('/auth/google',\n  passport.authenticate('google', { scope: ['profile'] }));\n\napp.get('/auth/google/callback', \n  passport.authenticate('google', { failureRedirect: '/login' }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\n  ```\n\n## Examples\n\nDevelopers using the popular [Express](http://expressjs.com/) web framework can\nrefer to an [example](https://github.com/passport/express-4.x-facebook-example)\nas a starting point for their own web applications.  The example shows how to\nauthenticate users using Facebook.  However, because both Facebook and Google\nuse OAuth 2.0, the code is similar.  Simply replace references to Facebook with\ncorresponding references to Google.\n\n## Sponsorship\n\nPassport is open source software.  Ongoing development is made possible by\ngenerous contributions from [individuals and corporations](https://github.com/jaredhanson/passport/blob/master/SPONSORS.md).\nTo learn more about how you can help keep this project financially sustainable,\nplease visit Jared Hanson's page on [Patreon](https://www.patreon.com/jaredhanson).\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012-2016 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n","maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"time":{"modified":"2023-04-26T06:21:58.019Z","created":"2016-02-04T01:11:12.327Z","1.0.0":"2016-02-04T01:11:12.327Z","2.0.0":"2019-03-08T23:40:25.910Z"},"homepage":"https://github.com/jaredhanson/passport-google-oauth2#readme","keywords":["passport","google","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-google-oauth2.git"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"bugs":{"url":"http://github.com/jaredhanson/passport-google-oauth2/issues"},"license":"MIT","readmeFilename":"README.md","users":{"mrbgit":true,"chirag8642":true,"yazanrawashdeh":true,"mnk":true,"hugovila":true,"kkho595":true,"krabello":true,"anatolie_sernii":true}}