You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Link to documentation URLs for files such as AUTHENTICATION and CONTRIBUTING.
* Remove README from the documentation files for gems that are using an OVERVIEW file.
* Update Stackdriver gems to have the same documentation files.
* Link to local AUTHENTICATION file from code instead of using external URL.
Copy file name to clipboardExpand all lines: AUTHENTICATION.md
+48-11Lines changed: 48 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,38 @@
1
1
# Authentication
2
2
3
-
In general, the google-cloud-ruby library uses [Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments, the Service Account credentials can be specified by providing the path to the [JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for the account (or the JSON itself) in environment variables. Additionally, Cloud SDK credentials can also be discovered automatically, but this is only recommended during development.
4
-
5
-
General instructions, environment variables, and configuration options are covered in the general [Authentication guide](http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/guides/authentication) for the `google-cloud` umbrella package. Specific instructions and environment variables for each individual service are linked from the README documents listed below for each service.
3
+
In general, the google-cloud-ruby library uses [Service
for the `google-cloud` umbrella package. Specific instructions and environment
18
+
variables for each individual service are linked from the README documents
19
+
listed below for each service.
6
20
7
21
## Creating a Service Account
8
22
9
-
Google Cloud requires a **Project ID** and **Service Account Credentials** to connect to the APIs. For detailed instructions on how to create a service account, see the [Authentication guide](docs/google-cloud/v0.12.2/guides/authentication#onyourownserver).
23
+
Google Cloud requires a **Project ID** and **Service Account Credentials** to
24
+
connect to the APIs. For detailed instructions on how to create a service
You will use the **Project ID** and **JSON key file** to connect to most services with google-cloud-ruby.
28
+
You will use the **Project ID** and **JSON key file** to connect to most
29
+
services with google-cloud-ruby.
12
30
13
31
## Project and Credential Lookup
14
32
15
-
The google-cloud-ruby library aims to make authentication as simple as possible, and provides several mechanisms to configure your system without providing **Project ID** and **Service Account Credentials** directly in code.
33
+
The google-cloud-ruby library aims to make authentication as simple as possible,
34
+
and provides several mechanisms to configure your system without providing
35
+
**Project ID** and **Service Account Credentials** directly in code.
16
36
17
37
**Project ID** is discovered in the following order:
18
38
@@ -30,11 +50,21 @@ The google-cloud-ruby library aims to make authentication as simple as possible,
30
50
31
51
### Google Cloud Platform environments
32
52
33
-
While running on Google Cloud Platform environments such as Google Compute Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed. The **Project ID** and **Credentials** and are discovered automatically. Code should be written as if already authenticated.
53
+
While running on Google Cloud Platform environments such as Google Compute
54
+
Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed.
55
+
The **Project ID** and **Credentials** and are discovered automatically. Code
56
+
should be written as if already authenticated.
34
57
35
58
### Environment Variables
36
59
37
-
The **Project ID** and **Credentials JSON** can be placed in environment variables instead of declaring them directly in code. Each service has its own environment variable, allowing for different service accounts to be used for different services. (See the READMEs for the individual service gems for details.) The path to the **Credentials JSON** file can be stored in the environment variable, or the **Credentials JSON** itself can be stored for environments such as Docker containers where writing files is difficult or not encouraged.
60
+
The **Project ID** and **Credentials JSON** can be placed in environment
61
+
variables instead of declaring them directly in code. Each service has its own
62
+
environment variable, allowing for different service accounts to be used for
63
+
different services. (See the READMEs for the individual service gems for
64
+
details.) The path to the **Credentials JSON** file can be stored in the
65
+
environment variable, or the **Credentials JSON** itself can be stored for
66
+
environments such as Docker containers where writing files is difficult or not
67
+
encouraged.
38
68
39
69
Here are the environment variables that Datastore checks for project ID:
40
70
@@ -50,16 +80,23 @@ Here are the environment variables that Datastore checks for credentials:
50
80
51
81
### Cloud SDK
52
82
53
-
This option allows for an easy way to authenticate during development. If credentials are not provided in code or in environment variables, then Cloud SDK credentials are discovered.
83
+
This option allows for an easy way to authenticate during development. If
84
+
credentials are not provided in code or in environment variables, then Cloud SDK
85
+
credentials are discovered.
54
86
55
87
To configure your system for this, simply:
56
88
57
89
1.[Download and install the Cloud SDK](https://cloud.google.com/sdk)
58
90
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
59
91
3. Write code as if already authenticated.
60
92
61
-
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK should only be used during development.
93
+
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
94
+
*should only be used during development.
62
95
63
96
## Troubleshooting
64
97
65
-
If you're having trouble authenticating open a [Github Issue](https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues/new?title=Authentication+question) to get help. Also consider searching or asking [questions](http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby) on [StackOverflow](http://stackoverflow.com).
98
+
If you're having trouble authenticating open a [Github
0 commit comments