-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding auth doc explaining all the ways to mint credentials. #805
Conversation
(and is an e-mail address) | ||
and the password is actually a private key file. | ||
A `Service Account`_ handles authentication for a backend service that | ||
needs to talk to other services (e.g. Google APIs). |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Changes Unknown when pulling 06918f1 on dhermes:add-gcloud-auth-docs into * on GoogleCloudPlatform:master*. |
LGTM |
Basic Example | ||
============= | ||
|
||
After downloading a JSON key for a service account (see `Service Accounts`_), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
06918f1
to
f6bba7b
Compare
Changes Unknown when pulling f6bba7b on dhermes:add-gcloud-auth-docs into * on GoogleCloudPlatform:master*. |
@jgeewax PTAL |
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 authenticateUse 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:
This means that in those environments, the following will 'just work': from gcloud import datastore
datastore.get(...) Specify a particular set of credentialsIf you want to be explicit about the credentials, do that by using [insert detail here]: # Note: I still think this is too long...
from gcloud import credentials
from gcloud import datastore
creds = credentials.get_for_service_account_json('/path/to/key.json')
datastore.set_default_connection(datastore.Connection(credentials=creds)) ... |
JFYI, I wrote a doc about usable auth recently: I also feel that we should advertise the simplest case (and most importantly, you can have the portable code which runs everywhere) first. |
Fixes #633.
Follow along changes in:
www.googledrive.com/host/0B8el7dRo8mVOekRaUm1wWnFLeUE
/cc @jgeewax