{"id":28125015,"url":"https://github.com/passport/todos-express-facebook","last_synced_at":"2025-05-14T09:19:52.211Z","repository":{"id":36255429,"uuid":"40559843","full_name":"passport/todos-express-facebook","owner":"passport","description":"Todo app using Express and Passport for log in with Facebook.","archived":false,"fork":false,"pushed_at":"2023-05-22T13:30:33.000Z","size":421,"stargazers_count":379,"open_issues_count":10,"forks_count":234,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-08T02:22:07.696Z","etag":null,"topics":["example","express","facebook","nodejs","oauth2","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":"2015-08-11T19:01:48.000Z","updated_at":"2025-04-11T04:24:31.000Z","dependencies_parsed_at":"2024-04-15T01:56:19.093Z","dependency_job_id":"9d12ec7b-589f-49c1-b167-28528ded0b0f","html_url":"https://github.com/passport/todos-express-facebook","commit_stats":{"total_commits":53,"total_committers":6,"mean_commits":8.833333333333334,"dds":0.1132075471698113,"last_synced_commit":"a7cdd5a0d903adf99dcc7d53b7b3f96980a975a3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-facebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-facebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-facebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/passport%2Ftodos-express-facebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/passport","download_url":"https://codeload.github.com/passport/todos-express-facebook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253729199,"owners_count":21954580,"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","facebook","nodejs","oauth2","passport","sqlite"],"created_at":"2025-05-14T09:19:51.913Z","updated_at":"2025-05-14T09:19:52.192Z","avatar_url":"https://github.com/passport.png","language":"CSS","funding_links":["https://github.com/sponsors/jaredhanson"],"categories":[],"sub_categories":[],"readme":"This example demonstrates how to use [Express](https://expressjs.com) 4.x and\n[Passport](https://www.passportjs.org) to log users in with [Facebook](https://www.facebook.com).\nUse this example as a starting point for your own web applications.\n\n## Quick Start\n\nTo get started with this example, clone the repository and install the\ndependencies.\n\n```bash\n$ git clone git@github.com:passport/express-4.x-facebook-example.git\n$ cd express-4.x-facebook-example\n$ npm install\n```\n\nThis example requires credentials from Facebook, which can be obtained by\n[creating](https://developers.facebook.com/docs/development/create-an-app) an\napp in the [App Dashboard](https://developers.facebook.com/apps).\nThe OAuth redirect URI of the app should be set to: `http://localhost:3000/oauth2/redirect/www.facebook.com`\n\nOnce credentials have been obtained, create a `.env` file and add the following\nenvironment variables:\n\n```\nFACEBOOK_CLIENT_ID={{INSERT_APP_ID_HERE}}\nFACEBOOK_CLIENT_SECRET={{INSERT_APP_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## Overview\n\nThis example illustrates how to use [Passport](https://www.passportjs.org) and\nthe [`passport-facebook`](https://www.passportjs.org/packages/passport-facebook/)\nstrategy within an [Express](https://expressjs.com) application to log users in\nwith [Facebook](https://www.facebook.com).\n\nThe example builds upon the scaffolding created by [Express generator](https://expressjs.com/en/starter/generator.html),\nand uses [EJS](https://ejs.co) as a view engine and plain CSS for styling.  This\nscaffolding was generated by executing:\n\n```\n$ express --view ejs express-4.x-facebook-example\n```\n\nThe example uses [SQLite](https://www.sqlite.org) for storing user accounts.\nSQLite is a lightweight database that works well for development, including this\nexample.\n\nAdded to the scaffolding are files which add authentication to the application.\n\n* [`boot/db.js`](boot/db.js)\n\n  This file initializes the database by creating the tables used to store user\n  accounts and credentials.\n\n* [`boot/auth.js`](boot/auth.js)\n\n  This file initializes Passport.  It configures the Facebook strategy and\n  supplies the serialization functions used for session management.\n\n* [`routes/auth.js`](routes/auth.js)\n\n  This file defines the routes used for authentication.  In particular, there\n  are three routes used to authenticate with Facebook:\n  \n  - `GET /login`\n  \n    This route renders a page that prompts the user to login with Facebook.\n  \n  - `GET /login/federated/www.facebook.com`\n  \n    This route begins the authentication sequence by redirecting the user to\n    Facebook.\n  \n  - `POST /oauth2/redirect/www.facebook.com`\n  \n    This route completes the authentication sequence when Facebook redirects the\n    user back to the application.  When a new user logs in, a user account is\n    automatically created and their Facebook account is linked.  When an\n    existing user returns, they are logged in to their linked account.\n\n## License\n\n[The Unlicense](https://opensource.org/licenses/unlicense)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-facebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassport%2Ftodos-express-facebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassport%2Ftodos-express-facebook/lists"}