We've got Google Analytics Reports API (and Google Analytics Reports) installed, and going through the Initial setup (setting the Client Id and Client Secret) reports a 400 return, with the reason "missing required parameter: scope". What I can google on this seems to imply this is a problem in the client request, not in the configuration in the Google Developers Console. Any idea what's going on with this?

Comments

Ben Coleman created an issue. See original summary.

Ben Coleman’s picture

Title: Initial setup on Google Analytics Reports API returns "missing required parameter scope" » Initial setup on Google Analytics Reports API returns "mi-ssing required parameter: scope"
Ben Coleman’s picture

Title: Initial setup on Google Analytics Reports API returns "mi-ssing required parameter: scope" » Initial setup on Google Analytics Reports API returns "missing required parameter: scope"
Plazik’s picture

After pressing "Start setup and authorize account" button you'll redirect to Google. Have the url of this page the scope parameter?

The full url should be like this:
https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http%3A//example.com/admin/config/system/google-analytics-reports-api&client_id=XXXXXXXXXX.apps.googleusercontent.com&scope=https%3A//www.googleapis.com/auth/analytics.readonly%20https%3A//www.google.com/analytics/feeds/&access_type=offline&approval_prompt=force

I've just tested it with 7.x-3.0-beta2 version and all works fine for me.

audaceamiel’s picture

audaceamiel’s picture

audaceamiel’s picture

audaceamiel’s picture

audaceamiel’s picture

audaceamiel’s picture

Plazik’s picture

@audaceamiel, I saw emails about changes in this issue but can't see any new post.
It seems you're trying to edit issue summary instead of adding new comment https://www.drupal.org/node/2608784/revisions.

Please add a new comment in field "Comment".

audaceamiel’s picture

audaceamiel’s picture

@Plazik

For my case, When i press the "Start setup and authorize account" , i am redirecting to this url :

https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_ur...

I dont' know why my url is short like this, is there some configurations on my drupal website that I have missed. Please help!!!

Plazik’s picture

This is strange. I think it's because of new anti spam filter.
@audaceamiel, I'm confirmed you're not a spammer. Please try again.

dddave’s picture

I've published audaceamiel's latest post. Mollom is going haywire at the moment and did not let any post through.

Ben Coleman’s picture

One of my cow-orkers has the credentials. I'll get them and re-try to get the redirect.

Plazik’s picture

@audaceamiel, which version are you using? 7.x-3.0-beta2 or 7.x-3.x-dev?
Have you updated from previous versions?
Have you installed Drupal on subdir or something like that?
Have you using Internationalization module?
Which version of php are you using? (See on admin/reports/status page).

Ben Coleman’s picture

I got the credentials for our account, and re-tried. This time, it worked. The original problem was on my cow-orker's PC, so I'm beginning to think this may be client-system-specific.

Plazik’s picture

@Ben Coleman, could you ask him my questons from #17 comment? We need to understand how to reproduce the problem.

Zod_42’s picture

Are you using the "Overlay" module? I was having this issue when using overlay, but resolved it using the default admin interface. I haven't tested it yet, but you may also be able to get around it by adding the overlay URL to the, "Authorized redirect URIs" list.

domignon’s picture

Using version 7.x-3.x-dev, the scope and client_id parameters are not sent by the module to google while authenticating thus resulting in Error 400. If these 2 parameters are added manually in the url, authentication is successful and redirection done though upon redirection, the module does not seem to have saved the client_id and client secret.

Plazik’s picture

@domignon, could you post the full error message? From dblog module.

domignon’s picture

There is no error message, the error shows up on google side. I must add the client ID and scope are not the only missing parameters, the redirect_url too since it is incomplete as it is shorten to the hostname with no '/admin/config/system/google-analytics-reports-api' which results in an error on dblog(provided that you manually set client ID and scope in the url as I explained before).

Code: 400, Error: Bad Request, Message:
Array
(
    [error] => redirect_uri_mismatch
) 
Plazik’s picture

@domignon, which OS, PHP version are you using?

There is no error message, the error shows up on google side.

Could you post the url on Google side? Without domain.

domignon’s picture

@Plazik Problem solved
Clean url needs to be activated. It is only when you asked about the url google was receiving that I wondered if that '?q=' was not behind all this issue.

Thanks for your assistance

Michael G’s picture

"Clean URLs" worked for me.

Thank you domignon.