Skip to content

Add support for default credentials.#4

Closed
orestica wants to merge 11 commits into
googleapis:masterfrom
orestica:master
Closed

Add support for default credentials.#4
orestica wants to merge 11 commits into
googleapis:masterfrom
orestica:master

Conversation

@orestica

@orestica orestica commented May 9, 2014

Copy link
Copy Markdown
Contributor

This pull request goes hand in hand with the following pull request: googleapis/oauth2client#6

Once these two pull requests are accepted and integrated into their respective repositories, a Google API call will be authenticated as simple as building the service like this:

service = build("compute", "v1", credential=GoogleCredential.get_default_credential())

This will work when the code is being run on a VM inside Google Compute Engine, a Google App Engine application or on any other off-fabric platform (in this last case, a credentials file needs to be put together containing either user or service account credentials and an environment variable pointed to it OR a 'gcloud auth login' command needs to be run before using the default credentials).

Comment thread googleapiclient/discovery.py Outdated

This comment was marked as spam.

This comment was marked as spam.

@craigcitro

Copy link
Copy Markdown
Contributor

One or two small notes, otherwise looks good -- we'll merge this when we merge the oauth2client change.

@craigcitro

Copy link
Copy Markdown
Contributor

Closing, was merged in #10

@craigcitro craigcitro closed this May 30, 2014
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.

3 participants