{"id":19792678,"url":"https://github.com/making/cf-oauth2-proxy-sidecar","last_synced_at":"2025-05-01T02:30:30.458Z","repository":{"id":136908431,"uuid":"254852859","full_name":"making/cf-oauth2-proxy-sidecar","owner":"making","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-11T14:14:36.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T07:43:11.084Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/making.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":"2020-04-11T11:27:10.000Z","updated_at":"2024-04-09T19:05:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a328ce3-b863-4898-8e93-5f7017b11160","html_url":"https://github.com/making/cf-oauth2-proxy-sidecar","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/making%2Fcf-oauth2-proxy-sidecar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcf-oauth2-proxy-sidecar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcf-oauth2-proxy-sidecar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Fcf-oauth2-proxy-sidecar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/making","download_url":"https://codeload.github.com/making/cf-oauth2-proxy-sidecar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812235,"owners_count":21647867,"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-12T07:07:40.081Z","updated_at":"2025-05-01T02:30:30.453Z","avatar_url":"https://github.com/making.png","language":"Shell","readme":"# Example Cloud Foundy Sidecar with OAuth2 Proxy\n\n* https://docs.cloudfoundry.org/devguide/sidecars.html\n* https://oauth2-proxy.github.io/oauth2-proxy\n\n![image](https://user-images.githubusercontent.com/106908/79045833-4415f280-7c48-11ea-894b-23e8164bd24c.png)\n\n## How to deploy\n\n### Install CF CLI 7\n\n```\nCF7_CLI_VERSION=7.0.0-beta.30\nwget -q -O cf.tgz \"https://packages.cloudfoundry.org/stable?release=macosx64-binary\u0026version=${CF7_CLI_VERSION}\u0026source=github-rel\" \u0026\u0026 \\\n    tar xzf cf.tgz \u0026\u0026 \\\n    sudo install cf7 /usr/local/bin/ \u0026\u0026 \\\n    rm -f cf* LICENSE NOTICE\n```\n\n### Download OAuth2 Proxy\n\n```\ncurl -Ls https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v5.1.0/oauth2_proxy-v5.1.0.linux-amd64.go1.14.tar.gz | tar xzv\nmv oauth2_proxy-*/oauth2_proxy ./\nrm -rf oauth2_proxy-*\n```\n\n### Deploy app with OAuth2 Proxy sidecar\n\n\n1. Create a new OAuth App: https://github.com/settings/developers\n1. Under Authorization callback URL enter the correct url ie `https://${TARGET_SUBDOMAIN}.${APPS_DOMAIN}/oauth2/callback`\n1. Create an user provided service with information you created above as follows:\n```\ncf7 create-user-provided-service github-oauth-app -p '{\"github_org\": \"YOUR-ORG\", \"github_client_id\": \"YOUR-CLIENT-ID\", \"github_client_secret\": \"YOUR-CLIENT-SECRET\"}'\n```\n1. Deploy with following steps:\n```\nAPP_NAME=hello\nAPPS_DOMAIN=$(cf7 curl \"/v2/shared_domains\" | jq -r \".resources[0].entity.name\")\nTARGET_SUBDOMAIN=demo-oauth2-proxy\n\ncf7 create-app ${APP_NAME}\nAPP_GUID=$(cf7 app ${APP_NAME} --guid)\ncf7 curl \"/v2/apps/${APP_GUID}\" -X PUT -d \"{\\\"ports\\\": [8080, 4180]}\"\n\ncf7 create-route ${APPS_DOMAIN} --hostname ${TARGET_SUBDOMAIN}\nROUTE_GUID=$(cf7 curl \"/v2/routes?q=host:${TARGET_SUBDOMAIN}\" | jq -r \".resources[0].metadata.guid\")\ncf7 curl /v2/route_mappings -X POST -d \"{\\\"app_guid\\\": \\\"${APP_GUID}\\\", \\\"route_guid\\\": \\\"${ROUTE_GUID}\\\", \\\"app_port\\\": 4180}\"\n\ncf7 apply-manifest\ncf7 push\n```\n\n\u003e Note: `Authorization callback URL` of the OAuth2 Apps must be `https://${TARGET_SUBDOMAIN}.${APPS_DOMAIN}/oauth2/callback`\n\nor you can use `deploy.sh` instead as follows:\n\n```\n./deploy hello demo-oauth2-proxy\n```\n\nGo to `https://${TARGET_SUBDOMAIN}.${APPS_DOMAIN}`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fcf-oauth2-proxy-sidecar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaking%2Fcf-oauth2-proxy-sidecar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Fcf-oauth2-proxy-sidecar/lists"}