Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedComment #3
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedComment #4
Plazik CreditAttribution: Plazik as a volunteer commentedAfter 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.
Comment #5
audaceamiel CreditAttribution: audaceamiel commentedComment #6
audaceamiel CreditAttribution: audaceamiel as a volunteer and commentedComment #7
audaceamiel CreditAttribution: audaceamiel commentedComment #8
audaceamiel CreditAttribution: audaceamiel as a volunteer commentedComment #9
audaceamiel CreditAttribution: audaceamiel commentedComment #10
audaceamiel CreditAttribution: audaceamiel commentedComment #11
Plazik CreditAttribution: Plazik as a volunteer commented@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".
Comment #12
audaceamiel CreditAttribution: audaceamiel commentedComment #13
audaceamiel CreditAttribution: audaceamiel commented@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!!!
Comment #14
Plazik CreditAttribution: Plazik as a volunteer commentedThis is strange. I think it's because of new anti spam filter.
@audaceamiel, I'm confirmed you're not a spammer. Please try again.
Comment #15
dddave CreditAttribution: dddave commentedI've published audaceamiel's latest post. Mollom is going haywire at the moment and did not let any post through.
Comment #16
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedOne of my cow-orkers has the credentials. I'll get them and re-try to get the redirect.
Comment #17
Plazik CreditAttribution: Plazik as a volunteer commented@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).Comment #18
Ben Coleman CreditAttribution: Ben Coleman at Accelerated Design, Inc. commentedI 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.
Comment #19
Plazik CreditAttribution: Plazik as a volunteer commented@Ben Coleman, could you ask him my questons from #17 comment? We need to understand how to reproduce the problem.
Comment #20
Zod_42 CreditAttribution: Zod_42 commentedAre 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.
Comment #21
domignon CreditAttribution: domignon commentedUsing 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.
Comment #22
Plazik CreditAttribution: Plazik as a volunteer commented@domignon, could you post the full error message? From dblog module.
Comment #23
domignon CreditAttribution: domignon commentedThere 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).
Comment #24
Plazik CreditAttribution: Plazik as a volunteer commented@domignon, which OS, PHP version are you using?
Could you post the url on Google side? Without domain.
Comment #25
domignon CreditAttribution: domignon commented@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
Comment #26
Michael G CreditAttribution: Michael G commented"Clean URLs" worked for me.
Thank you domignon.