{"id":13895149,"url":"https://github.com/gr2m/github-oauth-login","last_synced_at":"2026-01-07T21:43:50.339Z","repository":{"id":66069602,"uuid":"194577472","full_name":"gr2m/github-oauth-login","owner":"gr2m","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-15T00:01:34.000Z","size":5,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T22:53:20.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-01T01:05:30.000Z","updated_at":"2024-03-21T18:30:56.000Z","dependencies_parsed_at":"2023-02-20T19:00:42.863Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/github-oauth-login","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"7c5240e0087f4b4667f5a615a92f38dacc8a09cb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fgithub-oauth-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fgithub-oauth-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fgithub-oauth-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Fgithub-oauth-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/github-oauth-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246180923,"owners_count":20736460,"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":[],"created_at":"2024-08-06T18:02:01.946Z","updated_at":"2026-01-07T21:43:50.277Z","avatar_url":"https://github.com/gr2m.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# GitHub OAuth Login example\n\nThis is an example web app which uses your OAuth app for authentication.\n\nHere is a description about the OAuth [Web application flow](https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow).\n\n## Setup\n\n1. Serve the index.html over http(s)\n2. Create a new OAuth app\n3. Deploy an OAuth server\n4. Adapt index.html\n\n### Step 1: Serve the index.html over http(s)\n\nClone the repository (or alternatively download the ZIP file)\n\n```\ngit clone https://github.com/gr2m/github-oauth-login.git\ncd github-oauth-login\n```\n\nStart a server in the current folder. For example, if you have python installed, you can just run\n\n```\npython -m SimpleHTTPServer\n```\n\nThis will start a server at `http://localhost:8000`.\n\n### Step 2: Create a new OAuth app\n\nYou can create an OAuth app [with your account](https://github.com/settings/applications/new) or with a GitHub organization. Give the app a name and a homepage (neither matter). Set the **Authorization callback URL** to the URL from step 1, e.g. `http://localhost:8000`.\n\n### Step 3: Deploy an OAuth server\n\nYou need to deploy a small server which keeps the OAuth app’s secret safe, as it cannot be shared in the browser.\n\nThe simplest way to do that is [@HenrikJoreteg](https://github.com/HenrikJoreteg)’s [github-secret-keeper](https://github.com/HenrikJoreteg/github-secret-keeper). You can deploy it easily to https://glitch.com/. Press on \"New Project\" on the top right, then press the \"Clone from Git Repo\" button and paste in `https://github.com/HenrikJoreteg/github-secret-keeper.git`\n\nAfter the project is imported, edit the `package.json` file and add\n\n```json\n  \"scripts\": {\n    \"start\": \"node server.js\"\n  }\n```\n\nThen create a new file called `.env` and enter the following\n\n```\n\u003cclient id\u003e=\u003cclient secret\u003e\n```\n\nReplace `\u003cclient id\u003e` with your OAuth app’s clientid, and the same with `\u003cclient secret\u003e`. At the end it will look something like this\n\n```\naf35402964c3be2ada1c=3a919e462c79397ebf89dbe0338e112d25e94c1c\n```\n\n### 4. Adapt index.html\n\nFinally, edit the `index.html`.\n\nReplace `const CLIENT_ID = \"af3540296c43be2ada1c\";` with your app’s client ID. Replace `https://henrikjoreteg-github-secret-keeper.glitch.me/:client_id/:code` with your Glitch app’s URL.\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fgithub-oauth-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Fgithub-oauth-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Fgithub-oauth-login/lists"}