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

Got "Required parameter is missing: response_type" when browsing url provide by quickstart.php #24

Closed
marcebil opened this issue Sep 4, 2018 · 7 comments
Assignees

Comments

@marcebil
Copy link

marcebil commented Sep 4, 2018

I get credentials.json (attached credentials.zip) and I installed composer.
Then I run "composer quickstart.php" provided in the PHP quickstart page (quickstart.php attached)
I get this url to execute: (see phpquickstartOutput.jpg file attached)

https://accounts.google.com/o/oauth2/auth?%20response_type=code&access_type=offline&client_id=433334862655-7vdjqv2iaqhe452ekb8ib7t5hc2ujfqg.apps.go%20ogleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&state&scope=https%3A%2F%20%2Fwww.googleapis.com%2Fauth%2Factivity%20https%3A%2F%2Fwww.googleapis.com%2Fauth%20%2Fdrive.metadata.readonly&approval_prompt=auto

Expected Behavior

Actual Behavior

(See attached file BrowserError.jpg)
I received this error:
"
Required parameter is missing: response_type
response_type=code
access_type=offline
client_id=433334862655-7vdjqv2iaqhe452ekb8ib7t5hc2ujfqg.apps.go ogleusercontent.com
redirect_uri=urn:ietf:wg:oauth:2.0:oob
state=
scope=https:/ /www.googleapis.com/auth/activity https://www.googleapis.com/auth /drive.metadata.readonly
approval_prompt=auto
"

Steps to Reproduce the Problem

with the attached composer.json file

  1. Run "php quickstart.php (as provide)"

Specifications

  • PHP version (php -v): 7.0
  • OS (Mac/Linux/Windows): Windows 10

credentials.zip
phpquickstartoutput
quickstart.zip
browsererror

@asrivas asrivas self-assigned this Sep 9, 2018
@asrivas
Copy link
Contributor

asrivas commented Sep 9, 2018

Which PHP quickstart is this for?

@grant
Copy link
Contributor

grant commented Sep 9, 2018

It looks like the Drive Activity quickstart.

@asrivas
Copy link
Contributor

asrivas commented Sep 9, 2018

In the quickstart.php you linked for us I noticed you added an additional scope + some code for Google_Service_Appsactivity and changed the Composer vendor directory path. I was able to get to the OAuth consent screen successfully with your edits except the vendor directory path and my credentials.

Can you confirm you're able to successfully the Drive PHP quickstart as is?

@thabisomtolo
Copy link

Hey guys
Ireally need your help here i'm trying to connnect to google calendar API and all other poccess are working fine the problem start where im trying to enter a verification code from the link i get from the browser, please guys help me...

Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with mes
sage 'cURL error 60: SSL certificate problem: unable to get local issuer certifi
cate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in W:\HawkMobileCE
OMeetingsSite\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:186
Stack trace:
#0 W:\HawkMobileCEOMeetingsSite\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory
.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Han
dler\EasyHandle), Array)
#1 W:\HawkMobileCEOMeetingsSite\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory
.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler
\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler
CurlFactory))
#2 W:\HawkMobileCEOMeetingsSite\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler
.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlH
andler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFa
ctory))
#3 W:\HawkMobileCEOMeeting in W:\HawkMobileCEOMeetingsSite\vendor\guzzlehttp\guz
zle\src\Handler\CurlFactory.php on line 186

@marcebil
Copy link
Author

In the quickstart.php you linked for us I noticed you added an additional scope + some code for Google_Service_Appsactivity and changed the Composer vendor directory path. I was able to get to the OAuth consent screen successfully with your edits except the vendor directory path and my credentials.

Can you confirm you're able to successfully the Drive PHP quickstart as is?

Sorry for the delay and thanks to all the people who look at it. I just came back from an obligated rest.
Answering to asrivas:

  1. I just get again the last version of quickload.php from 'https://developers.google.com/drive/api/v3/quickstart/php'

  2. I only change the directory where i installed the composer, modifying the require include directory. And it is loading fine.

  3. Then I execute from the command line:
    'php quickstart.php'
    and get a link to browse to, which is:
    "
    https://accounts.google.com/o/oauth2/auth?%20response_type=code&access_type=offline&client_id=433334862655-7vdjqv2iaqhe452ekb8ib7t5hc2ujfqg.app%20s.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&state&scope=https%20%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly&prompt=select_account%20%20consent
    "

  4. I browse to the link
    I am suppoused to get a verification code from there, or some OAuth screen, but instead I received
    a 400 error cod: "Error: invalid_request Required parameter is missing: response_type"

So, answering your question, i am not being able to get to the OAuth consent screen, as you do.
(I had enabled the 'Drive Api' (getting the composer), and synchronized everything)

Any helps will be very welcome!

@marcebil
Copy link
Author

If it helps I can upload my composer.json file

@marcebil marcebil reopened this Oct 16, 2018
@grant
Copy link
Contributor

grant commented Oct 18, 2018

We can't help if you modify the sample. Please use StackOverflow for generic questions
Anu and I both couldn't find the issue you having, and it looks like the sample isn't being run as directed, so I'll close this issue.

If you still are finding an issue with this sample, please be very specific in a new issue.

Perhaps your credentials are incorrect. See issues like this:
https://stackoverflow.com/questions/11696526/google-oauth-2-response-type-error-on-token-request

@grant grant closed this as completed Oct 18, 2018
sqrrrl pushed a commit that referenced this issue Jul 6, 2022
test: added testcase for drive-v2 snippets
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

4 participants