{"id":36536473,"url":"https://github.com/imrenagi/go-oauth2-cli","last_synced_at":"2026-01-12T04:57:00.434Z","repository":{"id":56854425,"uuid":"280755642","full_name":"imrenagi/go-oauth2-cli","owner":"imrenagi","description":"Example Code for doing oauth2 flow by using cli/terminal","archived":false,"fork":false,"pushed_at":"2020-07-19T05:04:40.000Z","size":7558,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T02:53:47.995Z","etag":null,"topics":["cli","oauth2","oauth2-client"],"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/imrenagi.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}},"created_at":"2020-07-18T23:17:06.000Z","updated_at":"2024-01-16T22:41:14.000Z","dependencies_parsed_at":"2022-09-22T14:26:19.805Z","dependency_job_id":null,"html_url":"https://github.com/imrenagi/go-oauth2-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imrenagi/go-oauth2-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrenagi%2Fgo-oauth2-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrenagi%2Fgo-oauth2-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrenagi%2Fgo-oauth2-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrenagi%2Fgo-oauth2-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imrenagi","download_url":"https://codeload.github.com/imrenagi/go-oauth2-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrenagi%2Fgo-oauth2-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","oauth2","oauth2-client"],"created_at":"2026-01-12T04:56:59.727Z","updated_at":"2026-01-12T04:57:00.428Z","avatar_url":"https://github.com/imrenagi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GO-SSO-CLI\n===\n\nYou ever used tools which requires you to do login or authentication via termimnal like `gcloud auth login` or `argocd login` and wondering how to do oauth2 flow in cli or terminal? Here you go. I try to create a simple demo to demonstrate how Ouath2 can be done in terminal.\n\n![demo](./demo.gif)\n\n# Getting Started\n\nThis is a sample of ouath client. Thus, you gonna need to have oauth2 server up and running prior running using this example. There are options available:\n\n1. Use [dexidp/dex](https://github.com/dexidp/dex) as the oauth2 server. Simply run the dex server.\n1. Use google, github or any others oauth2 provider.\n\n## Testing Against Dex Server\n\nThis client sample use `example-app` oauth2 client id and secret registered on the dex server. Thus, you can run it by using:\n\n```\n$ make build.binaries\n$ ./authcli login --sso\n```\n\n## Testing Against Google or any other providers\n\nPlease create ouath2 client id and secret for any oauth2 provider you chose. You can use `http://127.0.0.1:8085/callback` as the redirectURL callback or override the value by using `--redirect-uri` flags.\n\nIf you want to use google, you can do something like \n\n```\n$ ./authcli login --sso --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] --issuer https://accounts.google.com\n```\n\n# Security Warning\n\nIf you handle the ouath2 provider callback and exchange the oauth code with access and refresh token on the client, you might need to put the oauth client secret somewhere or directly compiled it on the binary. At this point I'm not sure whether hard coding the app secret on the binary is safe or not. So do it on your own risk. If you think that is safe enough, please let me know.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrenagi%2Fgo-oauth2-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimrenagi%2Fgo-oauth2-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrenagi%2Fgo-oauth2-cli/lists"}