{"id":16564047,"url":"https://github.com/preichenberger/oauth2-router","last_synced_at":"2026-05-10T17:40:24.321Z","repository":{"id":57589430,"uuid":"136647351","full_name":"preichenberger/oauth2-router","owner":"preichenberger","description":"OAuth2 Router","archived":false,"fork":false,"pushed_at":"2018-06-12T07:25:23.000Z","size":2178,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T19:53:24.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/preichenberger.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}},"created_at":"2018-06-08T17:22:42.000Z","updated_at":"2023-06-09T04:01:21.000Z","dependencies_parsed_at":"2022-08-29T23:20:35.094Z","dependency_job_id":null,"html_url":"https://github.com/preichenberger/oauth2-router","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preichenberger%2Foauth2-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preichenberger%2Foauth2-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preichenberger%2Foauth2-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preichenberger%2Foauth2-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preichenberger","download_url":"https://codeload.github.com/preichenberger/oauth2-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241982777,"owners_count":20052557,"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-10-11T20:43:08.920Z","updated_at":"2026-05-10T17:40:24.286Z","avatar_url":"https://github.com/preichenberger.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"OAuth2 Router [![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/preichenberger/oauth2-router) [![Build Status](https://travis-ci.org/preichenberger/oauth2-router.svg?branch=master)](https://travis-ci.org/preichenberger/oauth2-router)\n========\n\nRedirects an OAuth2 callback to a URL specified in the state parameter with all query parameters from the original request.\nThis allows having one endpoint as the destination for different OAuth2 callbacks destinations. Allows for whitelisting redirect domains.\n\nPossible use cases:\n- Pull Request builds\n- Heroku Review Apps\n- any dynamic DNS hostname.\n\nSECURITY: This allows for arbitrary redirects of OAuth2 Authorization Codes. Please understand the implications before using this.\n\n## Install\n\n### Binary\nGrab a release from: https://github.com/preichenberger/oauth2-router/releases\n\n### Docker\nhttps://hub.docker.com/r/preichenberger/oauth2-router\n\n### Heroku\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n## Start\n```bash\n$ oauth2-router -port 3000 -whitelist 'localhost,*.google.com'\n$ 2018/06/08 12:48:09 Starting OAuth2 Router on port: 3000\n```\n\n## Client Implementation\nFor the following info:\n- Whitelist: localhost\n- OAuth2 Router redirect_uri: http://localhost:8080\n- Real redirect_uri: http://localhost:5000/random_endpoint?apple=pears\n\n1. Add the OAuth2 Router redirect_uri: http://localhost:8080 to your OAuth2 provider (Google, Facebook, Github, etc...)\n2. Create a JSON with any date to be passed in the OAuth2 state parameter. Add a redirect parameter, with the real redirect_uri\n```json\n{\n\t\"csrf\": \"39adsijdfiaj\",\n\t\"redirect\": \"http://localhost:5000/random_endpoint?apple=pears\"\n}\n```\n3. Base64 encode the json and set it as the state parameter in the OAuth2 implementation\n4. Use OAuth2\n\n## Tests\nRun tests\n```bash\n$ go ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreichenberger%2Foauth2-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreichenberger%2Foauth2-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreichenberger%2Foauth2-router/lists"}