{"id":22515171,"url":"https://github.com/fluential/gcp-oauth-token-info","last_synced_at":"2025-03-28T01:53:43.878Z","repository":{"id":266473643,"uuid":"898432159","full_name":"fluential/gcp-oauth-token-info","owner":"fluential","description":"Retrieve auth token information from Google OAuth2 endpoint","archived":false,"fork":false,"pushed_at":"2024-12-04T12:23:38.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T19:11:25.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/fluential.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":"2024-12-04T11:38:03.000Z","updated_at":"2024-12-04T12:23:42.000Z","dependencies_parsed_at":"2024-12-04T13:37:04.576Z","dependency_job_id":null,"html_url":"https://github.com/fluential/gcp-oauth-token-info","commit_stats":null,"previous_names":["fluential/gcp-oauth-token-info"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluential%2Fgcp-oauth-token-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluential%2Fgcp-oauth-token-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluential%2Fgcp-oauth-token-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluential%2Fgcp-oauth-token-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluential","download_url":"https://codeload.github.com/fluential/gcp-oauth-token-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245955203,"owners_count":20699891,"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-12-07T03:28:35.796Z","updated_at":"2025-03-28T01:53:43.856Z","avatar_url":"https://github.com/fluential.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gcp-oauth-token-info\nRetrieve auth token information from Google OAuth2 endpoint\n\nWhen working with remote GCP resources often it's good practice to relay on the CLOUDSDK_AUTH_ACCESS_TOKEN, this token can be easily obtained by doing running `gcloud auth print-access-token` and reused in a way like:\n\n```shell\n\u003e export CLOUDSDK_AUTH_ACCESS_TOKEN=\u003ctoken\u003e\n\u003e gcloud compute instances list\n```\n\nBut it's not easy to identify user identity of such tokens which is important when you work with different Service Account, environments etc.\nThis small snippet will retrieve token info from Google API endpoint:\n\n```shell\nexport CLOUDSDK_AUTH_ACCESS_TOKEN=\u003ctoken\u003e\n./gcp-oauth-token-info.py\n2024-12-04 05:44:50 - INFO - Token Information:\n2024-12-04 05:44:50 - INFO - {\n  \"azp\": \"721552944539.apps.googleusercontent.com\",\n  \"aud\": \"721552944539.apps.googleusercontent.com\",\n  \"sub\": \"777455885472527483726\",\n  \"scope\": \"https://www.googleapis.com/auth/accounts.reauth https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/sqlservice.login https://www.googleapis.com/auth/userinfo.email openid\",\n  \"exp\": \"1733315061\",\n  \"expires_in\": \"2370\",\n  \"email\": \"foo@bar\",\n  \"email_verified\": \"true\",\n  \"access_type\": \"offline\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluential%2Fgcp-oauth-token-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluential%2Fgcp-oauth-token-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluential%2Fgcp-oauth-token-info/lists"}