{"id":19581021,"url":"https://github.com/tsamaya/passport-example-with-google-oauth2","last_synced_at":"2026-04-29T23:04:56.975Z","repository":{"id":64248094,"uuid":"125650021","full_name":"tsamaya/passport-example-with-google-oauth2","owner":"tsamaya","description":"a Passport example using an Express with Google OAuth2 ","archived":false,"fork":false,"pushed_at":"2023-03-02T06:45:12.000Z","size":1466,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-09T05:21:53.799Z","etag":null,"topics":["bulma","express","google","javascript","oauth2","passport","tutorial"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsamaya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-17T16:48:08.000Z","updated_at":"2022-12-14T22:48:47.000Z","dependencies_parsed_at":"2024-11-11T07:42:31.013Z","dependency_job_id":null,"html_url":"https://github.com/tsamaya/passport-example-with-google-oauth2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsamaya%2Fpassport-example-with-google-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsamaya%2Fpassport-example-with-google-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsamaya%2Fpassport-example-with-google-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsamaya%2Fpassport-example-with-google-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsamaya","download_url":"https://codeload.github.com/tsamaya/passport-example-with-google-oauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849012,"owners_count":19867617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulma","express","google","javascript","oauth2","passport","tutorial"],"created_at":"2024-11-11T07:31:55.833Z","updated_at":"2026-04-29T23:04:51.935Z","avatar_url":"https://github.com/tsamaya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# passport-example-with-google-oauth2\n\nThis repository is a [Passport](http://www.passportjs.org/) example using an [Express](http://expressjs.com/) application with an authentication using Google-OAuth2 authorization.\n\n## Usage\n\n#### Create an OAuth 2.0 client ID\n\nFirst, create a project at [console.developers.google.com](https://console.developers.google.com)\n\n*Create authorization credentials*\n\n1. Open the [Credentials page](https://console.developers.google.com/apis/credentials) in the API Console.\n\n  ![Google console](./resources/googlecredentials.png)\n\n2. Fill the form for in the _Oauth consent screen_ tab, only the *Product name shown to users* is mandatory\n\n  ![Google console](./resources/googleconsentscreen.png)\n\n3. Back in _Credentials_ tab,  Click *Create credentials \u003e OAuth client ID*.\n\n4. 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`.\n\n5. click *Create*\n\n*Enable Google+ Library*\n\n1. Open the [Library page](https://console.developers.google.com/apis/library) in the API console.\n\n2. Search for *Google+ API*\n\n![Google console](./resources/googlesearchlibrary.png)\n\n3. Enable this API\n\n![Google console](./resources/googleenablegoogleplus.png)\n\n\n#### Configure Strategy\n\ncreate a `.env` file with:\n```\nGOOGLE_CLIENT_ID=YOUR-CLIENT-ID\nGOOGLE_CLIENT_SECRET=YOUR-CLIENT-SECRET\n```\n\n#### Install dependencies\n\n```sh\n$ npm install\n```\n\nor\n\n```sh\n$ yarn\n```\n\n#### Run\n\n```sh\n$ npm start\n```\n\nor\n\n```sh\n$ yarn start\n```\n\nopen your browser on [localhost:3000](http://localhost:3000)\n\n![Home](./resources/pleaselogin.png)\n\n\u003c!-- use the menu login link\n\n![with](./resources/loginwith.png)\n\nLog with Google\n\n![google](./resources/signingoogle.png)\n\nLogged in\n\n![google](./resources/helloarnaud.png)\n\nCheck your profile\n\n![with](./resources/account.png) --\u003e\n\n## Resources\n\n- Passport [Facebook example](https://github.com/passport/express-4.x-facebook-example) from [@jaredhanson](https://github.com/jaredhanson)\n- [Bulma](https://bulma.io/) CSS framework based on Flexbox, from [@jgthms](https://github.com/jgthms)\n\n## Contributing\nAnyone and everyone is very welcome to contribute.\n\n## Issues\nFind a bug or want to request a new feature? Please let me know by submitting an issue.\n\n## Licensing\nLicensed under the MIT License\n\nA copy of the license is available in the repository's [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsamaya%2Fpassport-example-with-google-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsamaya%2Fpassport-example-with-google-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsamaya%2Fpassport-example-with-google-oauth2/lists"}