├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── lib └── index.js ├── package.json └── test ├── bootstrap └── node.js └── package.test.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: jaredhanson 2 | ko_fi: jaredhanson 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ** READ THIS FIRST! ** 2 | 3 | #### Are you looking for help? 4 | 5 | Reminder: The issue tracker is not a support forum. 6 | 7 | Issues should only be filed in this project once they are able to be reproduced 8 | and confirmed as a flaw in the software or incorrect information in associated 9 | documention. 10 | 11 | If you are encountering problems integrating this module into your application, 12 | please post a question on the [discussion forum](https://github.com/passport/discuss) 13 | rather than filing an issue. 14 | 15 | #### Is this a security issue? 16 | 17 | Do not open issues that might have security implications. Potential security 18 | vulnerabilities should be reported privately to jaredhanson@gmail.com. Once any 19 | vulerabilities have been repaired, the details will be disclosed publicly in a 20 | responsible manner. This also allows time for coordinating with affected parties 21 | in order to mitigate negative consequences. 22 | 23 | 24 | If neither of the above two scenarios apply to your situation, you should open 25 | an issue. Delete this paragraph and the text above, and fill in the information 26 | requested below. 27 | 28 | 29 | 30 | 31 | 32 | 33 | ### Expected behavior 34 | 35 | 36 | 37 | ### Actual behavior 38 | 39 | 40 | 41 | ### Steps to reproduce 42 | 43 | 44 | 45 | ```js 46 | // Format code using Markdown code blocks 47 | ``` 48 | 49 | ### Environment 50 | 51 | * Operating System: 52 | * Node version: 53 | * passport version: 54 | * passport-google-oauth version: 55 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ** READ THIS FIRST! ** 2 | 3 | #### Are you implementing a new feature? 4 | 5 | Requests for new features should first be discussed on the [developer forum](https://github.com/passport/develop). 6 | This allows the community to gather feedback and assess whether or not there is 7 | an existing way to achieve the desired functionality. 8 | 9 | If it is determined that a new feature needs to be implemented, include a link 10 | to the relevant discussion along with the pull request. 11 | 12 | #### Is this a security patch? 13 | 14 | Do not open pull requests that might have security implications. Potential 15 | security vulnerabilities should be reported privately to jaredhanson@gmail.com. 16 | Once any vulerabilities have been repaired, the details will be disclosed 17 | publicly in a responsible manner. This also allows time for coordinating with 18 | affected parties in order to mitigate negative consequences. 19 | 20 | 21 | If neither of the above two scenarios apply to your situation, you should open 22 | a pull request. Delete this paragraph and the text above, and fill in the 23 | information requested below. 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ### Checklist 33 | 34 | 35 | 36 | 37 | - [ ] I have read the [CONTRIBUTING](https://github.com/jaredhanson/passport-google-oauth/blob/master/CONTRIBUTING.md) guidelines. 38 | - [ ] I have added test cases which verify the correct operation of this feature or patch. 39 | - [ ] I have added documentation pertaining to this feature or patch. 40 | - [ ] The automated test suite (`$ make test`) executes successfully. 41 | - [ ] The automated code linting (`$ make lint`) executes successfully. 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | docs/ 2 | reports/ 3 | 4 | # Mac OS X 5 | .DS_Store 6 | 7 | # Node.js 8 | node_modules 9 | npm-debug.log 10 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "bitwise": true, 4 | "camelcase": true, 5 | "curly": true, 6 | "forin": true, 7 | "immed": true, 8 | "latedef": true, 9 | "newcap": true, 10 | "noarg": true, 11 | "noempty": true, 12 | "nonew": true, 13 | "quotmark": "single", 14 | "undef": true, 15 | "unused": true, 16 | "trailing": true, 17 | "laxcomma": true 18 | } 19 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | docs/ 3 | examples/ 4 | reports/ 5 | test/ 6 | 7 | .jshintrc 8 | .travis.yml 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: "node_js" 2 | node_js: 3 | - "11" 4 | - "10" 5 | - "9" 6 | - "8" 7 | - "7" 8 | - "6" 9 | - "5" 10 | - "4" 11 | - "3" # io.js 12 | - "2" # io.js 13 | - "1" # io.js 14 | - "0.12" 15 | - "0.10" 16 | - "0.8" 17 | 18 | 19 | # NOTE: `istanbul` and `coveralls` are pinned for compatibility with node 0.8. 20 | before_install: 21 | - "npm install -g istanbul@0.2.2" 22 | - "npm install -g coveralls@2.11.4" 23 | 24 | script: 25 | - "make check" 26 | 27 | after_success: 28 | - "make report-cov" 29 | 30 | sudo: false 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | ### Tests 4 | 5 | The test suite is located in the `test/` directory. All new features are 6 | expected to have corresponding test cases with complete code coverage. Patches 7 | that increase test coverage are happily accepted. 8 | 9 | Ensure that the test suite passes by executing: 10 | 11 | ```bash 12 | $ make test 13 | ``` 14 | 15 | Coverage reports can be generated and viewed by executing: 16 | 17 | ```bash 18 | $ make test-cov 19 | $ make view-cov 20 | ``` 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2016 Jared Hanson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include node_modules/make-node/main.mk 2 | 3 | MOCHAFLAGS = --require ./test/bootstrap/node 4 | 5 | 6 | # Perform self-tests. 7 | check: test 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # passport-google-oauth 2 | 3 | [Passport](http://passportjs.org/) strategies for authenticating with [Google](http://www.google.com/) 4 | using OAuth 1.0a and OAuth 2.0. 5 | 6 | This is a meta-module that combines [passport-google-oauth1](https://github.com/jaredhanson/passport-google-oauth1) 7 | and [passport-google-oauth20](https://github.com/jaredhanson/passport-google-oauth2). 8 | It exists for backwards-compatibility with applications making use of the 9 | combined package. As of version 1.0.0, it is encouraged to declare dependencies 10 | on the module that implements the specific version of OAuth needed. 11 | 12 |
13 | 14 | :brain: [Understanding OAuth 2.0](https://www.passportjs.org/concepts/oauth2/?utm_source=github&utm_medium=referral&utm_campaign=passport-google-oauth&utm_content=nav-concept) • 15 | :heart: [Sponsors](https://www.passportjs.org/sponsors/?utm_source=github&utm_medium=referral&utm_campaign=passport-google-oauth&utm_content=nav-sponsors) 16 | 17 |
18 | 19 | [![npm](https://img.shields.io/npm/v/passport-google-oauth.svg)](https://www.npmjs.com/package/passport-google-oauth) 20 | [![build](https://img.shields.io/travis/jaredhanson/passport-google-oauth.svg)](https://travis-ci.org/jaredhanson/passport-google-oauth) 21 | [![coverage](https://img.shields.io/coveralls/jaredhanson/passport-google-oauth.svg)](https://coveralls.io/github/jaredhanson/passport-google-oauth) 22 | [...](https://github.com/jaredhanson/passport-google-oauth/wiki/Status) 23 | 24 | ## Install 25 | 26 | $ npm install passport-google-oauth 27 | 28 | ## License 29 | 30 | [The MIT License](http://opensource.org/licenses/MIT) 31 | 32 | Copyright (c) 2012-2016 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> 33 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | // Load modules. 2 | var OAuthStrategy = require('passport-google-oauth1') 3 | , OAuth2Strategy = require('passport-google-oauth20'); 4 | 5 | // Exports. 6 | exports.Strategy = 7 | exports.OAuthStrategy = OAuthStrategy; 8 | exports.OAuth2Strategy = OAuth2Strategy; 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "passport-google-oauth", 3 | "version": "2.0.0", 4 | "description": "Google (OAuth) authentication strategies for Passport.", 5 | "keywords": [ 6 | "passport", 7 | "google", 8 | "auth", 9 | "authn", 10 | "authentication", 11 | "identity" 12 | ], 13 | "author": { 14 | "name": "Jared Hanson", 15 | "email": "jaredhanson@gmail.com", 16 | "url": "http://www.jaredhanson.net/" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/jaredhanson/passport-google-oauth.git" 21 | }, 22 | "bugs": { 23 | "url": "http://github.com/jaredhanson/passport-google-oauth/issues" 24 | }, 25 | "license": "MIT", 26 | "licenses": [ 27 | { 28 | "type": "MIT", 29 | "url": "http://opensource.org/licenses/MIT" 30 | } 31 | ], 32 | "main": "./lib", 33 | "dependencies": { 34 | "passport-google-oauth1": "1.x.x", 35 | "passport-google-oauth20": "2.x.x" 36 | }, 37 | "devDependencies": { 38 | "make-node": "0.4.6", 39 | "mocha": "2.x.x", 40 | "chai": "2.x.x" 41 | }, 42 | "engines": { 43 | "node": ">= 0.4.0" 44 | }, 45 | "scripts": { 46 | "test": "make test" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test/bootstrap/node.js: -------------------------------------------------------------------------------- 1 | var chai = require('chai'); 2 | 3 | global.expect = chai.expect; 4 | -------------------------------------------------------------------------------- /test/package.test.js: -------------------------------------------------------------------------------- 1 | var strategy = require('..'); 2 | 3 | describe('passport-oauth', function() { 4 | 5 | it('should export Strategy constructors', function() { 6 | expect(strategy.OAuthStrategy).to.be.a('function'); 7 | expect(strategy.OAuth2Strategy).to.be.a('function'); 8 | }); 9 | 10 | it('should alias Strategy to OAuthStrategy', function() { 11 | expect(strategy.Strategy).to.equal(strategy.OAuthStrategy); 12 | }); 13 | 14 | }); 15 | --------------------------------------------------------------------------------