Skip to content
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

missing the required redirect URI #22

Closed
omerkhanjadoon opened this issue Aug 23, 2018 · 9 comments
Closed

missing the required redirect URI #22

omerkhanjadoon opened this issue Aug 23, 2018 · 9 comments
Assignees

Comments

@omerkhanjadoon
Copy link

omerkhanjadoon commented Aug 23, 2018

i am getting the following error when i try to run quick.php (which is named as quickstart in google drive api docs) i have copy paste the exact code but getting the error when i run it from my command line

Error:

PHP Fatal error:  Uncaught InvalidArgumentException: missing the required redirect URI in C:\xampp\htdocs\dnew\vendor\google\auth\src\OAuth2.php:650
Stack trace:
#0 C:\xampp\htdocs\dnew\vendor\google\apiclient\src\Google\Client.php(339): Google\Auth\OAuth2->buildFullAuthorizationUri(Array)
#1 C:\xampp\htdocs\dnew\quick.php(26): Google_Client->createAuthUrl()
#2 C:\xampp\htdocs\dnew\quick.php(58): getClient()
#3 {main}
  thrown in C:\xampp\htdocs\dnew\vendor\google\auth\src\OAuth2.php on line 650

Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in C:\xampp\htdocs\dnew\vendor\google\auth\src\OAuth2.php:650
Stack trace:
#0 C:\xampp\htdocs\dnew\vendor\google\apiclient\src\Google\Client.php(339): Google\Auth\OAuth2->buildFullAuthorizationUri(Array)
#1 C:\xampp\htdocs\dnew\quick.php(26): Google_Client->createAuthUrl()
#2 C:\xampp\htdocs\dnew\quick.php(58): getClient()
#3 {main}
  thrown in C:\xampp\htdocs\dnew\vendor\google\auth\src\OAuth2.php on line 650

Specifications

  • PHP version (php -v-7.2.1):
  • OS (Windows):
@erickoledadevrel erickoledadevrel self-assigned this Aug 27, 2018
@erickoledadevrel
Copy link

Did you download the credentials.json file using the button in the quickstart? Please check that it has an "installed" key at the root.

@pradeep-savitr
Copy link

pradeep-savitr commented Aug 28, 2018

I am getting the following error

any help appreciated.

Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:187
Stack trace:
#0 C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array)
#1 C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#2 C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))
#3 C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle in C:\wamp64\www\gdsample\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 187

@erickoledadevrel
Copy link

@uday-savitr - That is an unrelated issue. Please see the troubleshooting section for how to resolve it: https://developers.google.com/gmail/api/quickstart/php#troubleshooting

@erickoledadevrel erickoledadevrel changed the title i am geeting an error missing the required redirect URI Aug 28, 2018
@erickoledadevrel
Copy link

Closing due to inactivity.

@paulcanning
Copy link

I have this same issue.

I have a credentials.json, but it does not has an 'installed' key in it. Also, I'm unsure if my json file is made correctly.

@erickoledadevrel
Copy link

Did you use the button on the quickstart page? It should ensure the correct settings are used.

@inside83
Copy link

I used type 'Web browser' and got an error

PHP Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in /root/vendor/google/auth/src/OAuth2.php:675

https://developers.google.com/gmail/api/quickstart/php#troubleshooting says "This code requires an OAuth client ID of type Other" but 'Other' isn't offered as an option in the dropdown menu.
image

@timcamps
Copy link

I used type 'Web browser' and got an error

PHP Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in /root/vendor/google/auth/src/OAuth2.php:675

https://developers.google.com/gmail/api/quickstart/php#troubleshooting says "This code requires an OAuth client ID of type Other" but 'Other' isn't offered as an option in the dropdown menu.
image

Make sure you have added the Redirect URI in your Client-ID:
image

Also don't forget to download and replace the credentials.json file after you have made any changes:
image

@okellojohnsilas
Copy link

I used type 'Web browser' and got an error
PHP Fatal error: Uncaught InvalidArgumentException: missing the required redirect URI in /root/vendor/google/auth/src/OAuth2.php:675
https://developers.google.com/gmail/api/quickstart/php#troubleshooting says "This code requires an OAuth client ID of type Other" but 'Other' isn't offered as an option in the dropdown menu.
image

Make sure you have added the Redirect URI in your Client-ID: image

Also don't forget to download and replace the credentials.json file after you have made any changes: image

This was very helpful.
Thanks a lot for this

sqrrrl pushed a commit that referenced this issue Jul 6, 2022
feat: added new snippets for drive-v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants