{"id":15750868,"url":"https://github.com/rgl/use-oauth2-proxy","last_synced_at":"2025-03-31T07:21:27.035Z","repository":{"id":139753626,"uuid":"560754449","full_name":"rgl/use-oauth2-proxy","owner":"rgl","description":"oauth2-proxy as an GitHub authenticating reverse proxy example","archived":false,"fork":false,"pushed_at":"2022-11-02T18:42:31.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T11:56:52.350Z","etag":null,"topics":["oauth2","oidc","openid-connect"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rgl.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-11-02T07:31:15.000Z","updated_at":"2022-11-02T18:42:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"81371ad7-021c-4673-879e-feeb29a14733","html_url":"https://github.com/rgl/use-oauth2-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fuse-oauth2-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fuse-oauth2-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fuse-oauth2-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fuse-oauth2-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/use-oauth2-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429440,"owners_count":20775809,"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":["oauth2","oidc","openid-connect"],"created_at":"2024-10-04T07:00:33.855Z","updated_at":"2025-03-31T07:21:27.010Z","avatar_url":"https://github.com/rgl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\n[oauth2-proxy](https://github.com/oauth2-proxy/oauth2-proxy) as an GitHub authenticating reverse proxy example.\n\n# Usage\n\nAdd `127.0.0.1 example.test` to your `hosts` file.\n\nRegister a [new GitHub OAuth Application](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/oauth_provider#github-auth-provider) with:\n\n| Setting                      | Value                                      |\n|------------------------------|--------------------------------------------|\n| `Homepage URL`               | `http://example.test:4180`                 |\n| `Authorization callback URL` | `http://example.test:4180/oauth2/callback` |\n\nGenerate a new client secret, and export the created application OAuth credentials as environemnt variables:\n\n```bash\nexport OAUTH2_PROXY_PROVIDER='github'\nexport OAUTH2_PROXY_SCOPE='user:email'\n#export OAUTH2_PROXY_GITHUB_USER='rgl'\nexport OAUTH2_PROXY_CLIENT_ID='YOUR_OAUTH2_PROXY_GITHUB_APP_CLIENT_ID'\nexport OAUTH2_PROXY_CLIENT_SECRET='YOUR_OAUTH2_PROXY_GITHUB_APP_CLIENT_SECRET'\n```\n\nDownload `oauth2-proxy`:\n\n```bash\nwget https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v7.4.0/oauth2-proxy-v7.4.0.windows-amd64.tar.gz\ntar xf oauth2-proxy-v7.4.0.windows-amd64.tar.gz --strip-components 1\n```\n\nStart the `oauth2-proxy` service:\n\n```bash\nexport OAUTH2_PROXY_COOKIE_SECRET=\"$(openssl rand -hex 16)\"\n./oauth2-proxy \\\n    --email-domain=* \\\n    --http-address=:4180 \\\n    --redirect-url=http://example.test:4180/oauth2/callback \\\n    --cookie-secure=false \\\n    --cookie-samesite=strict \\\n    --upstream=http://localhost:4181/example \\\n    --upstream=\"file:///$(cygpath --windows \"$PWD\" | tr \\\\\\\\ /)/#/\"\n```\n\nIn another shell, build and start the example service:\n\n```bash\ncd example\ngo build\n./example -listen 127.0.0.1:4181\n```\n\nAccess the root endpoint:\n\n1. http://example.test:4180\n\nAccess some of the [endpoints](https://oauth2-proxy.github.io/oauth2-proxy/docs/features/endpoints):\n\n1. http://example.test:4180/oauth2/userinfo\n1. http://example.test:4180/oauth2/sign_out\n\n# Alternatives\n\n* [caddy-security](https://github.com/greenpau/caddy-security)\n* [ory](https://github.com/ory)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fuse-oauth2-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fuse-oauth2-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fuse-oauth2-proxy/lists"}