Skip to content

Adding auth doc explaining all the ways to mint credentials. - #805

Closed
dhermes wants to merge 1 commit into
googleapis:masterfrom
dhermes:add-gcloud-auth-docs
Closed

Adding auth doc explaining all the ways to mint credentials.#805
dhermes wants to merge 1 commit into
googleapis:masterfrom
dhermes:add-gcloud-auth-docs

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 7, 2015

This comment was marked as spam.

@coveralls

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 06918f1 on dhermes:add-gcloud-auth-docs into * on GoogleCloudPlatform:master*.

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver Thanks for the review, I'll hold off on merging until @jgeewax takes a look.

Comment threaddocs/gcloud-auth.rst Outdated

This comment was marked as spam.

This comment was marked as spam.

@dhermes
dhermesforce-pushed the add-gcloud-auth-docs branch from 06918f1 to f6bba7bCompareApril 7, 2015 23:53
@coveralls

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling f6bba7b on dhermes:add-gcloud-auth-docs into * on GoogleCloudPlatform:master*.

@dhermes

Copy link
Copy Markdown
ContributorAuthor

@jgeewax PTAL

@jgeewax

Copy link
Copy Markdown
Contributor

OK, I was just attempting to explain to someone how this might work, and realized that, when coming from a totally fresh spot, it was much less helpful than I'd hoped. It feels a bit like "here is a page of formulas organized by complexity of the code you have to write" rather than "here's the tasks you might want to do and how you get them done".


Are there any objections to making this more "use-case" oriented? The way I'd picture it is:

Ways to authenticate

Use the 'default credentials'

If you're running in any of the following environments, we can detect both your credentials and the project ID (and dataset ID for Cloud Datastore) automatically:

  • GAE
  • ...

This means that in those environments, the following will 'just work':

fromgcloudimportdatastoredatastore.get(...)

Specify a particular set of credentials

If you want to be explicit about the credentials, do that by using [insert detail here]:

# Note: I still think this is too long...fromgcloudimportcredentialsfromgcloudimportdatastorecreds=credentials.get_for_service_account_json('/path/to/key.json')
datastore.set_default_connection(datastore.Connection(credentials=creds))

...

@tmatsuo

Copy link
Copy Markdown
Contributor

JFYI, I wrote a doc about usable auth recently:
https://cloud.google.com/pubsub/configure

I also feel that we should advertise the simplest case (and most importantly, you can have the portable code which runs everywhere) first.

@dhermesdhermes closed this Aug 27, 2015
@dhermes
dhermes deleted the add-gcloud-auth-docs branch August 27, 2015 15:48
parthea pushed a commit that referenced this pull request Nov 24, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
…ented (#805)
Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 26, 2025
For downscoping CAB flow, the STS endpoint may not return the expiration
field for certain source credentials. The generated downscoped token
should always have the same expiration time as the source credentials.
When no `expires_in` field is returned in the response, we can just get
the expiration time from the source credentials.
Co-authored-by: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com>
parthea added a commit that referenced this pull request Mar 2, 2026
* chore: release 2.3.10
Release-As: 2.3.10
* mark 2.13.9 as taken
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authcla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add auth doc; Document 3LO via "gcloud login"

6 participants

@dhermes@coveralls@tseaver@jgeewax@tmatsuo@googlebot