{"id":18397909,"url":"https://github.com/jmgogo/oauth2-app","last_synced_at":"2025-04-12T15:23:52.945Z","repository":{"id":237367272,"uuid":"794389347","full_name":"jmgogo/oauth2-app","owner":"jmgogo","description":"Basic setup of OAuth2 Authentication for an app through GitHub.","archived":false,"fork":false,"pushed_at":"2024-05-03T01:48:50.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T02:41:20.851Z","etag":null,"topics":["authentication","express","express-session","javascript","oauth2","passport-github2","passportjs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmgogo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-01T03:31:51.000Z","updated_at":"2024-05-03T01:48:54.000Z","dependencies_parsed_at":"2024-05-01T04:31:36.793Z","dependency_job_id":"2dbde54e-a9ee-4dfe-8c65-6968f59902e6","html_url":"https://github.com/jmgogo/oauth2-app","commit_stats":null,"previous_names":["jgome284/oauth2-app","jmgogo/oauth2-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Foauth2-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Foauth2-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Foauth2-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Foauth2-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmgogo","download_url":"https://codeload.github.com/jmgogo/oauth2-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248587250,"owners_count":21129197,"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":["authentication","express","express-session","javascript","oauth2","passport-github2","passportjs"],"created_at":"2024-11-06T02:19:12.662Z","updated_at":"2025-04-12T15:23:52.918Z","avatar_url":"https://github.com/jmgogo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth2 with GitHub 🔓\n\n## About\n\nThis project provides a basic web app that authenticates users via an OAuth2 strategy on GitHub.\n\n## Prerequisites\n\n### Container Engine\n\nThe easiest way to get started is by leveraging the dev container in this repo. You will need a Container Engine like Docker installed and running. For Docker, the easiest way to start the container engine is via Docker Desktop.\n\n### Visual Studio Code\n\nThe dev container provided is set up for use on Visual Studio Code. Have it installed along with the [remote development pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) to enable the IDE's DevContainers functionality.\n\n## Getting started\n\nWith the terminal, clone this repository via `git clone https://github.com/jgome284/oauth2-app` in a directory of your choice. \n\nMake sure you have your container engine running. Open your local copy of the project on VS Code and start the development container by running Dev Containers: Rebuild and Reopen In Container in the command palette. It can be accessed with the keyboard shortcut `ctrl + shift + P` on your keyboard.\n\nWhen the Dev Container launches, install project dependencies via npm by executing the following command.\n\n\u003e npm install\n\nIf successful, a node_modules folder should appear in your directory. \n\nYou will also need to register the app on GitHub for OAuth2 Authentication. To do so, reference [the following instructions](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app). Name the app whatever you want. Fill out the Homepage URL and Authorization Callback URL as follows: \n\n- **Homepage URL:** http://localhost:3000\n- **Authorization Callback URL:** http://localhost:3000/auth/github/callback\n\nWith the app registered, you will receive a Client ID. Generate a Client Secret and make sure you copy it to your clipboard. Add the Client ID and Client Secret variables to a `.env` file at the root of your directory as follows.\n\n```.env\nGITHUB_CLIENT_ID=\u003cYOUR CLIENT ID\u003e\nGITHUB_CLIENT_SECRET=\u003cYOUR CLIENT SECRET\u003e\n```\n\nTo start the web app run the following command.\n\n\u003e npm start\n\nThen, launch the web app on localhost:3000 and sign in through GitHub to test our OAuth 2 authentication strategy! ... Yay! (ﾉ◕ヮ◕)ﾉ*:･ﾟ🎊!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgogo%2Foauth2-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmgogo%2Foauth2-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgogo%2Foauth2-app/lists"}