This repository is a Passport example using an Express application with an authentication using Google-OAuth2 authorization.
First, create a project at console.developers.google.com
Create authorization credentials
- Open the Credentials page in the API Console.
- Fill the form for in the Oauth consent screen tab, only the Product name shown to users is mandatory
-
Back in Credentials tab, Click Create credentials > OAuth client ID.
-
Complete the form. Set the application type to Web application. Fill the Authorized redirect URIs, here with our local server use
http://127.0.0.1:3000/auth/google/callback
. -
click Create
Enable Google+ Library
-
Open the Library page in the API console.
-
Search for Google+ API
- Enable this API
create a .env
file with:
GOOGLE_CLIENT_ID=YOUR-CLIENT-ID
GOOGLE_CLIENT_SECRET=YOUR-CLIENT-SECRET
$ npm install
or
$ yarn
$ npm start
or
$ yarn start
open your browser on localhost:3000
- Passport Facebook example from @jaredhanson
- Bulma CSS framework based on Flexbox, from @jgthms
Anyone and everyone is very welcome to contribute.
Find a bug or want to request a new feature? Please let me know by submitting an issue.
Licensed under the MIT License
A copy of the license is available in the repository's LICENSE file.