{"id":13510197,"url":"https://github.com/prose/gatekeeper","last_synced_at":"2025-05-16T18:10:44.220Z","repository":{"id":3374438,"uuid":"4421756","full_name":"prose/gatekeeper","owner":"prose","description":"Enables client-side applications to dance OAuth with GitHub.","archived":false,"fork":false,"pushed_at":"2023-03-01T10:22:36.000Z","size":88,"stargazers_count":764,"open_issues_count":20,"forks_count":185,"subscribers_count":22,"default_branch":"development","last_synced_at":"2025-04-12T17:46:30.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-05-23T15:23:48.000Z","updated_at":"2025-03-25T19:10:29.000Z","dependencies_parsed_at":"2023-02-13T02:01:54.763Z","dependency_job_id":null,"html_url":"https://github.com/prose/gatekeeper","commit_stats":{"total_commits":62,"total_committers":19,"mean_commits":3.263157894736842,"dds":0.6612903225806452,"last_synced_commit":"7703f8c2ee7df67362f6eb114a512acc06a64744"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prose%2Fgatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prose%2Fgatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prose%2Fgatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prose%2Fgatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prose","download_url":"https://codeload.github.com/prose/gatekeeper/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582907,"owners_count":22095518,"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-01T02:01:28.117Z","updated_at":"2025-05-16T18:10:44.202Z","avatar_url":"https://github.com/prose.png","language":"JavaScript","funding_links":[],"categories":["Tips, tricks, tools, and add-ons for GitHub power users","JavaScript","others"],"sub_categories":[],"readme":"Gatekeeper\n==========\n\nBecause of some [security-related limitations](http://blog.vjeux.com/2012/javascript/github-oauth-login-browser-side.html), Github prevents you from implementing the OAuth Web Application Flow on a client-side only application.\n\nThis is a real bummer. So we built Gatekeeper, which is the missing piece you need in order to make it work.\n\nGatekeeper works well with [Github.js](http://github.com/michael/github), which helps you access the [Github API](http://developer.github.com/v3/) from the browser. Gatekeeper is free to use under the [MIT license](https://github.com/prose/gatekeeper/blob/master/LICENSE).\n\n## New Release\n\n:tada: We are currently working on releasing a new major version of gatekeeper. You can join the discussion and get involved by following this [issue](https://github.com/prose/gatekeeper/issues/38). :tada:\n\n## API\n\n```\nGET http://localhost:9999/authenticate/TEMPORARY_CODE\n```\n\n## OAuth Steps\n\nAlso see the [documentation on Github](http://developer.github.com/v3/oauth/).\n\n1. Redirect users to request GitHub access.\n\n   ```\n   GET https://github.com/login/oauth/authorize\n   ```\n\n2. GitHub redirects back to your site including a temporary code you need for the next step.\n\n   You can grab it like so:\n\n   ```js\n   var code = window.location.href.match(/\\?code=(.*)/)[1];\n   ```\n\n3. Request the actual token using your instance of Gatekeeper, which knows your `client_secret`.\n\n   ```js\n   $.getJSON('http://localhost:9999/authenticate/'+code, function(data) {\n     console.log(data.token);\n   });\n   ```\n\n## Setup your Gatekeeper\n\n1. Clone it\n\n    ```\n    git clone git@github.com:prose/gatekeeper.git\n    ```\n\n2. Install Dependencies\n\n    ```\n    cd gatekeeper \u0026\u0026 npm install\n    ```\n\n3. Adjust config.json\n\n   ```json\n   {\n     \"oauth_client_id\": \"GITHUB_APPLICATION_CLIENT_ID\",\n     \"oauth_client_secret\": \"GITHUB_APPLICATION_CLIENT_SECRET\",\n     \"oauth_host\": \"github.com\",\n     \"oauth_port\": 443,\n     \"oauth_path\": \"/login/oauth/access_token\",\n     \"oauth_method\": \"POST\",\n     \"port\": 9999\n   }\n   ```\n\n   You can also set environment variables to override the settings if you don't want Git to track your adjusted config.json file. Just use UPPER_CASE keys.\n\n4. Serve it\n\n   ```\n   $ node index.js\n   ```\n\n## Run using Docker\n\nYou can build and run the docker image:\n```bash\ndocker build -t gatekeeper .\ndocker run -p 443:443 -p 9999:9999 --name gatekeeper-server gatekeeper\n```\n\nOr run it with a .env file:\n```bash\ndocker run -p 443:443 -p 9999:9999 --env-file .env --name gatekeeper-server gatekeeper\n```\n\nOr run using the docker hub image:\n```bash\ndocker run -p 443:443 -p 9999:9999 --name gatekeeper-server ludwigschubi/gatekeeper\n```\n\n## Deploy on Heroku\n\n### Heroku Button\n\nUse the button below to instantly setup your own Gatekeeper instance on Heroku.\n\n[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n\n### Heroku manually\n\n1. Create a new Heroku app\n\n   ```\n   heroku apps:create APP_NAME\n   ```\n\n3. Provide OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET:\n\n   ```\n   heroku config:set OAUTH_CLIENT_ID=XXXX OAUTH_CLIENT_SECRET=YYYY\n   ```\n\n4. Push changes to heroku\n\n   ```\n   git push heroku master\n   ```\nOR\n\n   ```\n   heroku restart\n   ```\n\n## Deploy on Azure\n\n### Azure Button\n\nUse the button below to instantly setup your own Gatekeeper instance on Azure.\n\n[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)\n\n### Azure manually\n\n1. Create a new Azure site\n\n   ```\n   azure site create SITE_NAME --git\n   ```\n\n2. Provide OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET:\n\n   ```\n   azure site appsetting add OAUTH_CLIENT_ID=XXXX\n   azure site appsetting add OAUTH_CLIENT_SECRET=YYYY\n   ```\n\n3. Push changes to Azure\n\n   ```\n   git push azure master\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprose%2Fgatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprose%2Fgatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprose%2Fgatekeeper/lists"}