googleapis / google-auth-library-python

Google Auth Python Library
https://googleapis.dev/python/google-auth/latest/
Apache License 2.0
773 stars 302 forks source link

feat: Added Temporary token based authentication similar to cli --access-token-file #1467

Open AmitChotaliya opened 8 months ago

AmitChotaliya commented 8 months ago

Fixes #1165

This features allows using access token in the sdk without having any of the GCP related credentials.

Example Usage:

def generate_access_token():
creds, project = google.auth.default()

creds.refresh(Request())
return creds.token, creds.expiry

- Copy this access token to a different/local machine or container having no other google credentials.
- Set the required environment variable.
```bash
export GOOGLE_TEMPORARY_ACCESS_TOKEN=token copied from above
google-cla[bot] commented 8 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

conventional-commit-lint-gcf[bot] commented 8 months ago

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/