Skip to content

[Discussion] oauth2client credentials in a post-oauth2client world. #2814

@theacodes

Description

@theacodes

We recently switched core to use google-auth in #2639 and completely removed support for oauth2client.

It is possible that some users are explicitly passing oauth2client credentials into Client constructors, e.g.:

credentials = oauth2client.contrib.gce.AppAppsertionCredentials()
storage_client = storage.Client(credentials=credentials)

After google-cloud-core==0.22.0 is released this code will no longer work. Only credentials from google-auth will work. There is a potential that we could break some user code and there may be some valid reasons for sticking with oauth2client in the near-term (user credentials and storage, for example).

google-auth offers a way to convert credentials:

import google.auth._oauth2client

new_credentials = google.auth._oauth2client.convert(old_credentials)

We have two options:

  1. Tell users who still want to use oauth2client to use google.auth._oauth2client to convert their credentials.
  2. Add code in our Client base class to automatically convert credentials and issue a warning.

I strongly prefer (1) so that we do not prolong oauth2client's lifetime and so that we can more quickly free ourselves to switch http libraries.

Metadata

Metadata

Assignees

Labels

authtype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions