Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for using impersonate service account with gcloud cli #456

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rebaz94
Copy link

@rebaz94 rebaz94 commented Oct 5, 2022

Fixes #454

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 19, 2022

Can you point me to docs that explain the impersonate values?

@rebaz94
Copy link
Author

rebaz94 commented Oct 19, 2022

I can't find the docs for that but other client like Java already implemented this, you can check here.

When you run this command: gcloud auth application-default login --impersonate-service-account=principal@example.iam.gserviceaccount.com

it generate a file called application_default_credentials.json with the following content like below, and this PR just use the right value if type is impersonated_service_account

{
  "service_account_impersonation_url": "",
  "source_credentials": {
    "client_id": "",
    "client_secret": "",
    "refresh_token": "",
    "type": "authorized_user"
  },
  "type": "impersonated_service_account"
}

googleapis_auth/CHANGELOG.md Outdated Show resolved Hide resolved
@kevmoo
Copy link
Collaborator

kevmoo commented Oct 19, 2022

@rebaz94 – is there an issue open for this?

@rebaz94
Copy link
Author

rebaz94 commented Oct 19, 2022

@rebaz94 – is there an issue open for this?

yes here #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auth: Support impersonate service account with gcloud cli
2 participants