{"id":16696417,"url":"https://github.com/gbevan/github-insttoken","last_synced_at":"2026-05-20T06:32:10.041Z","repository":{"id":85849958,"uuid":"155239671","full_name":"gbevan/github-insttoken","owner":"gbevan","description":"Go binary to get a GitHub App ephemeral Installation token for a repository to allow git `clone` / `pull` etc operations over https (e.g. if in a network where ssh access is not permitted)","archived":false,"fork":false,"pushed_at":"2018-11-11T13:01:34.000Z","size":11,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T21:49:18.514Z","etag":null,"topics":["github","https","installation","jwt","proxy","token"],"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/gbevan.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-29T15:55:16.000Z","updated_at":"2021-07-20T10:03:29.000Z","dependencies_parsed_at":"2023-03-06T20:45:45.875Z","dependency_job_id":null,"html_url":"https://github.com/gbevan/github-insttoken","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/gbevan%2Fgithub-insttoken","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbevan%2Fgithub-insttoken/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbevan%2Fgithub-insttoken/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbevan%2Fgithub-insttoken/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbevan","download_url":"https://codeload.github.com/gbevan/github-insttoken/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243511158,"owners_count":20302513,"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":["github","https","installation","jwt","proxy","token"],"created_at":"2024-10-12T17:28:28.121Z","updated_at":"2026-05-20T06:32:09.997Z","avatar_url":"https://github.com/gbevan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-insttoken\n\nGo binary to get a GitHub App ephemeral Installation token for a repository to allow\ngit `clone` / `pull` etc operations over https.\n\nThis is to simplify the steps detailed in [authenticating-with-github-apps](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/)\n\n## Usage:\n```bash\n./github-insttoken \\\n  --private-key-file YOURGITHUBAPP.2018-10-26.private-key.pem \\\n  --app-id APP_ID \\\n  --repo Organisation/project \\\n  --git-url https://github.example.com/api/v3\n```\nReturns:\n```\ntoken: v1.2a04[...snip...]5172\n```\n\nThis can now be used in a git clone:\n```bash\ngit clone https://x-access-token:v1.2a04[...snip...]5172@github.com/Organisation/project.git\n```\n\n## ISSUE: Via Proxy\nIf you get a 401 Unauthorized error attempting to resolve the JWT into\nan Installation Token when going via a proxy.  Use the workaround below with\nthe `--jwt-only` option:\n```bash\n./github-insttoken --private-key-file YOURGITHUBAPP.2018-10-26.private-key.pem \\\n  --app-id APP-ID \\\n  --jwt-only\n```\nReturns:\n```\njwt: eyJhbGciOi[...snip...]FJn7HnGA0Pr7A\n```\nThen follow github instructions using curl to resolve to the final token.\n\nGet Installation ID for your repo\n```bash\ncurl -i -H \"Authorization: Bearer $JWT\" \\\n  -H \"Accept: application/vnd.github.machine-man-preview+json\" \\\n  https://github.example.com/api/v3/repos/Organisation/project/installation\n```\nYou want the returned id:\n```json\n{\n  \"id\": 77,\n  ...\n}\n```\n\nNow you can request the Installation token using the above id:\n```bash\ncurl -i -H \"Authorization: Bearer $JWT\" \\\n  -H \"Accept: application/vnd.github.machine-man-preview+json\" \\\n  https://github.example.com/api/v3/app/installations/77/access_tokens \\\n  -X POST\n```\nReturns:\n```json\n{\n  \"token\": \"v1.f5f76[...snip...]99cc7f93\",\n  \"expires_at\": \"2018-11-07T10:24:00Z\"\n}\n```\nYou can now use this token to `git clone ...` as above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbevan%2Fgithub-insttoken","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbevan%2Fgithub-insttoken","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbevan%2Fgithub-insttoken/lists"}