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
Copy file name to clipboardExpand all lines: README.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,27 +83,37 @@ foreach ($results as $item) {
83
83
84
84
> An example of this can be seen in [`examples/simple-file-upload.php`](examples/simple-file-upload.php).
85
85
86
-
**NOTE:** If you are using Google App Engine or Google Compute Engine, you can skip steps 1-3, as Application Default Credentials are included automatically when `useApplicationDefaultCredentials` is called.
87
-
88
86
1. Follow the instructions to [Create Web Application Credentials](https://developers.google.com/api-client-library/php/auth/web-app#creatingcred)
89
87
1. Download the JSON credentials
90
-
1. Set the path to these credentials using the `GOOGLE_APPLICATION_CREDENTIALS` environment variable:
88
+
1. Set the path to these credentials using `Google_Client::setAuthConfig`:
1. Tell the Google client to use your service account credentials to authenticate:
95
+
1. Set the scopes required for the API you are going to call
97
96
98
97
```php
99
-
$client = new Google_Client();
100
-
$client->useApplicationDefaultCredentials();
98
+
$client->addScope(Google_Service_Drive::DRIVE);
101
99
```
102
100
103
-
1. If you have delegated domain-wide access to the service account and you want to impersonate a user account, specify the email address of the user account using the method setSubject:
101
+
1. Set your application's redirect URI
104
102
105
103
```php
106
-
$ client->setSubject($user_to_impersonate);
104
+
// Your redirect URI can be any registered URI, but in this example
0 commit comments