Closed SamMalcolm closed 6 years ago
Which quickstart is this from?
Hello! So you will need to set the redirect URI in your Google_Client
instance before calling createAuthUrl
. For example:
$client = new Google_Client();
$client->setRedirectUri('https://mywebsite.com/auth/callback');
$client->setAuthConfig('/path/to/service_account.json');
$url = $client->createAuthUrl();
@asrivas PHP Quickstart for the google sheets api v4
I had download an incorrectly configured crednetials.json file as i must have selected the wront prefrences. As suchh im closing this issue, thanks for your input @asrivas and @bshaffer
No worries, glad you figured it out!
(Please search existing issues before creating a new one.)
Sample:
Expected Behavior
Actual Behavior
Terminal throws an error: Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in /Users/e32398/Sites/composer_test/vendor/google/auth/src/OAuth2.php:650 Stack trace:
0 /Users/e32398/Sites/composer_test/vendor/google/apiclient/src/Google/Client.php(339): Google\Auth\OAuth2->buildFullAuthorizationUri(Array)
1 /Users/e32398/Sites/composer_test/quickstart.php(26): Google_Client->createAuthUrl()
2 /Users/e32398/Sites/composer_test/quickstart.php(58): getClient()
3 {main}
thrown in /Users/e32398/Sites/composer_test/vendor/google/auth/src/OAuth2.php on line 650
Steps to Reproduce the Problem
Specifications
php -v
): 7.1.7