Skip to content

oauthclient.OAuth2Credentials does not implement create_scoped or create_scoped_required #1412

@tuanavu

Description

@tuanavu

Right now, the gcloud-python API only authorize through service account. Can we add the user authorization using client_secret.json file?

https://developers.google.com/identity/protocols/OAuth2WebServer

from oauth2client import client
from oauth2client.file import Storage
from oauth2client import tools

FLOW = flow_from_clientsecrets('client_secret.json',
                               scope='https://www.googleapis.com/auth/bigquery')
storage = Storage('bigquery_credentials.dat')
credentials = storage.get()
if credentials is None or credentials.invalid:
    credentials = run(FLOW, storage)
http = httplib2.Http()
http = credentials.authorize(http)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions