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
Remove AuthCredentials and related classes, use google-auth-library-java instead (#1375)
* Remove AuthCredentials and related classes, use google-auth-library-java instead
* Throw NPE when setCredentials is called with null
* Fix wording in main README's Authentication section
* Add NoCredentials class and remove setNoCredentials method
Copy file name to clipboardExpand all lines: README.md
+39-16
Original file line number
Diff line number
Diff line change
@@ -115,40 +115,63 @@ Most `google-cloud` libraries require a project ID. There are multiple ways to
115
115
Authentication
116
116
--------------
117
117
118
-
First, ensure that the necessary Google Cloud APIs are enabled for your project. To do this, follow the instructions on the [authentication document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/authentication/readme.md#authentication) shared by all the gcloud language libraries.
shared by all the Google Cloud language libraries.
119
129
120
130
Next, choose a method for authenticating API requests from within your project:
121
131
122
-
1. When using `google-cloud` libraries from within Compute/App Engine, no additional authentication steps are necessary.
123
-
2. When using `google-cloud` libraries elsewhere, there are three options:
124
-
*[Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). After downloading that key, you must do one of the following:
125
-
* Define the environment variable GOOGLE_APPLICATION_CREDENTIALS to be the location of the key. For example:
132
+
1. When using `google-cloud` libraries from within Compute/App Engine, no additional authentication
* Supply the JSON credentials file when building the service options. For example, this Storage object has the necessary permissions to interact with your Google Cloud Storage data:
145
+
* Supply the JSON credentials file when building the service options. For example, this Storage
146
+
object has the necessary permissions to interact with your Google Cloud Storage data:
* If running locally fordevelopment/testing, you can use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login`incommand line). Be sure to set your project ID as described above.
137
-
* If you already have an OAuth2 access token, you can use it to authenticate (notice that in this case the access token will not be automatically refreshed):
153
+
* If running locally for development/testing, you can use the
154
+
[Google Cloud SDK](https://cloud.google.com/sdk/). Create Application Default Credentials with
155
+
`gcloud auth application-default login`, and then`google-cloud` will automatically detect such
156
+
credentials.
157
+
* If you already have an OAuth2 access token, you can use it to authenticate (notice that in this
158
+
case, the access token will not be automatically refreshed):
0 commit comments