Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Upgrade credentials to JWT-based credentials if appropriate #177

Open
theacodes opened this issue Mar 29, 2017 · 0 comments
Open

Upgrade credentials to JWT-based credentials if appropriate #177

theacodes opened this issue Mar 29, 2017 · 0 comments

Comments

@theacodes
Copy link

Some APIs can benefit from using JWT-based credentials over OAuth 2.0-based credentials. Those APIs should upgrade to jwt.OnDemandCredentials if they are provided an instance of google.auth.credentials.Signing.

So, for example:

credentials, _ = google.auth.default()

if isinstance(credentials, google.auth.credentials.Signing):
    jwt_credentials = google.auth.jwt.OnDemandCredentials.from_signing_credentials(credentials)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant