{"id":21320134,"url":"https://github.com/deep1144/openq-github-oauth-server","last_synced_at":"2026-03-19T19:52:47.446Z","repository":{"id":159807792,"uuid":"494362770","full_name":"Deep1144/OpenQ-Github-OAuth-Server","owner":"Deep1144","description":"A simple express server that can easily be configured to serve multiple OAuth apps.","archived":false,"fork":false,"pushed_at":"2022-05-21T16:32:24.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"production","last_synced_at":"2025-01-22T11:28:11.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/Deep1144.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":"2022-05-20T07:21:53.000Z","updated_at":"2022-02-23T08:57:02.000Z","dependencies_parsed_at":"2024-02-21T23:00:27.143Z","dependency_job_id":null,"html_url":"https://github.com/Deep1144/OpenQ-Github-OAuth-Server","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deep1144%2FOpenQ-Github-OAuth-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deep1144%2FOpenQ-Github-OAuth-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deep1144%2FOpenQ-Github-OAuth-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Deep1144%2FOpenQ-Github-OAuth-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Deep1144","download_url":"https://codeload.github.com/Deep1144/OpenQ-Github-OAuth-Server/tar.gz/refs/heads/production","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801365,"owners_count":20350104,"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-11-21T19:45:24.565Z","updated_at":"2026-01-03T03:40:03.371Z","avatar_url":"https://github.com/Deep1144.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Multiapp OAuth Server\n\nAdd a `.env` file in the root of the project with:\n\n```\nOPENQ_ID=5fbd39c6916b7efb63cc\nOPENQ_SECRET=\u003cget from an admin\u003e\nORIGIN_URL='http://localhost:3000'\n```  \n\nA simple express server that can easily be configured to serve multiple OAuth apps.\n\nThe problem is that each OAuth app needs its own server endpoint to exchange an auth code for an access token.\n\nhttps://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github\n\nI am working with GitHub OAuth quite often and most of the time it's the only reason I need a server. The token exchange can not happen publically because that would reveal your app secret. I'm a bit tired of setting up a server with just this one endpoint each time, so I created this handy little express server that simply takes a URL parameter to choose which OAuth app credentials to use.\n\n```\ngit clone https://github.com/mktcode/github-multiapp-oauth-server.git\ncd github-multiapp-oauth-server\nnpm ci\n```\n\nThen create a `.env` file with one or more OAuth app client ID and secret pairs.\n\n```\nMYAPP_ID=...\nMYAPP_SECRET=...\nOTHERAPP_ID=...\nOTHERAPP_SECRET=...\n```\n\nNow you can start the server and make requests like this:\n\n```\nnpm start\n```\n\n```\nGET http://localhost:3000/?app=otherapp\u0026code=...\n```\n\nYou can also set the port and a path prexis in `.env`:\n\n```\nPORT=3001\nPATH_PREFIX=/github-oauth\n```\n\n# CORS\n\nBy default all origins are allowed but you can restrict it per app.\n\n```\nOTHERAPP_ORIGIN=https://yourdomain.com,https://dev.yourdomain.com\n```\n\n# Deploy\n\nTag a commit as local, development, staging or production to deploy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep1144%2Fopenq-github-oauth-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeep1144%2Fopenq-github-oauth-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep1144%2Fopenq-github-oauth-server/lists"}