{"id":28125074,"url":"https://github.com/passport/todos-express-google","last_synced_at":"2025-07-07T05:37:46.956Z","repository":{"id":43981684,"uuid":"451667065","full_name":"passport/todos-express-google","owner":"passport","description":"Todo app using Express and Passport for sign in with Google.","archived":false,"fork":false,"pushed_at":"2023-06-23T19:52:31.000Z","size":32,"stargazers_count":50,"open_issues_count":3,"forks_count":35,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-21T07:31:44.585Z","etag":null,"topics":["example","express","google","nodejs","openid-connect","passport","sqlite"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/passport.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"jaredhanson"}},"created_at":"2022-01-24T23:22:14.000Z","updated_at":"2025-06-17T17:11:35.000Z","dependencies_parsed_at":"2024-04-15T01:56:15.738Z","dependency_job_id":"eae28c11-222d-455b-9571-f4c3c8fc34b1","html_url":"https://github.com/passport/todos-express-google","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"e63651dcf4e0ce57272c576256566e222599011e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/passport/todos-express-google","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-google","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-google/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-google/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-google/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passport","download_url":"https://codeload.github.com/passport/todos-express-google/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-google/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261928833,"owners_count":23231559,"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":["example","express","google","nodejs","openid-connect","passport","sqlite"],"created_at":"2025-05-14T09:20:04.461Z","updated_at":"2025-07-07T05:37:46.950Z","avatar_url":"https://github.com/passport.png","language":"CSS","funding_links":["https://github.com/sponsors/jaredhanson"],"categories":[],"sub_categories":[],"readme":"# todos-express-google\n\nThis app illustrates how to use [Passport](https://www.passportjs.org/) with\n[Express](https://expressjs.com/) to sign users in with [Google](https://www.google.com/).\nUse this example as a starting point for your own web applications.\n\n## Quick Start\n\nTo run this app, clone the repository and install dependencies:\n\n```bash\n$ git clone https://github.com/passport/todos-express-google.git\n$ cd todos-express-google\n$ npm install\n```\n\nThis app requires OAuth 2.0 credentials from Google, which can be obtained by\n[setting up](https://developers.google.com/identity/protocols/oauth2/openid-connect#appsetup)\na project in [Google API console](https://console.developers.google.com/apis/).\nThe redirect URI of the OAuth client should be set to `'http://localhost:3000/oauth2/redirect/google'`.\n\nOnce credentials have been obtained, create a `.env` file and add the following\nenvironment variables:\n\n```\nGOOGLE_CLIENT_ID=__INSERT_CLIENT_ID_HERE__\nGOOGLE_CLIENT_SECRET=__INSERT_CLIENT_SECRET_HERE__\n```\n\nStart the server.\n\n```bash\n$ npm start\n```\n\nNavigate to [`http://localhost:3000`](http://localhost:3000).\n\n## Tutorial\n\nFollow along with the step-by-step [Sign In with Google Tutorial](https://www.passportjs.org/tutorials/google/)\nto learn how this app was built.\n\n## Overview\n\nThis app illustrates how to build a todo app with sign in functionality using\nExpress, Passport, and the [`passport-google-oidc`](https://www.passportjs.org/packages/passport-google-oidc/)\nstrategy.\n\nThis app is a traditional web application, in which application logic and data\npersistence resides on the server.  HTML pages and forms are rendered by the\nserver and client-side JavaScript is not utilized (or kept to a minimum).\n\nThis app is built using the Express web framework.  Data is persisted to a\n[SQLite](https://www.sqlite.org/) database.  HTML pages are rendered using [EJS](https://ejs.co/)\ntemplates, and are styled using vanilla CSS.\n\nWhen a user first arrives at this app, they are prompted to sign in.  To sign\nin, the user is redirected to Google using OpenID Connect.  Once authenticated,\na login session is established and maintained between the server and the user's\nbrowser with a cookie.\n\nAfter signing in, the user can view, create, and edit todo items.  Interaction\noccurs by clicking links and submitting forms, which trigger HTTP requests.\nThe browser automatically includes the cookie set during login with each of\nthese requests.\n\nWhen the server receives a request, it authenticates the cookie and restores the\nlogin session, thus authenticating the user.  It then accesses or stores records\nin the database associated with the authenticated user.\n\n## Next Steps\n\n* Add additional social login providers.\n\n  Study [todos-express-social](https://github.com/passport/todos-express-social)\n  to learn how to add multiple providers, giving users the choice of which\n  social network account to use when signing in.\n\n* Add passwordless.\n\n  Study [todos-express-webauthn](https://github.com/passport/todos-express-webauthn)\n  to learn how to let users sign in with biometrics or a security key.\n\n## License\n\n[The Unlicense](https://opensource.org/licenses/unlicense)\n\n## Credit\n\nCreated by [Jared Hanson](https://www.jaredhanson.me/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-google","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassport%2Ftodos-express-google","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-google/lists"}