Google Docs repository and Moodle 2.3 problem

Google Docs repository and Moodle 2.3 problem

by Eric Smith -
Number of replies: 18

I am aware that the new Google Docs repository requires us to input our OAuth domain and secret key. I've done this, but am still getting errors when a user tries to use the repository (they hit login).

Google returns the following error:

Error: invalid_client

The details are:

Any thoughts on what I'm doing wrong here?

 

Average of ratings: -
In reply to Eric Smith

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -
Hi Eric,

It sounds like you might've input the OAuth details incorrectly, could you double check they are exactly correct and you've not missed part of it out? Else check your settings against the screenshots/description here:

http://docs.moodle.org/23/en/Google_OAuth_2.0_setup

I know this process is a bit complicated so if there are any places we can make the documentation clearer then please let me know!
In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Dan -  I tried on the QA Moodle - I saw that it seemed already to have been set up in ettings > Site administration > Plugins > Repositories > Google Docs. but when I tried to add a file from Google, after being prompted to log in I got this (see below) Is this specific to the QA setup or is it a general error? I am assuming it has been set up on the QA master site. I haven't checked Mt Orange demo but will do so.

In reply to Mary Cooch

Re: Google Docs repository and Moodle 2.3 problem

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Oh -actually - I know what the issue must be with QA Moodle, having just played around on the school demo -the redirect is not right.  How is Google docs meant to work on QA Moodle? Are you setting it up in the master for people to use or are those with admin rights to the QA Moodle supposed to set up their own effort? Just wondering.

In reply to Mary Cooch

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -
Hi Mary,

I think that the QA site should be pre-configured by Moodle HQ. If its not already please could you raise a MDLSITE issue.

thanks,

Dan
In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Eric Smith -

Actually, that did it. I must have missed the link to the OAuth 2.0 setup in the http://docs.moodle.org/23/en/Google_Docs_repository page.

Thanks!

In reply to Eric Smith

Re: Google Docs repository and Moodle 2.3 problem

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I tried following the instructions in Google OAuth 2.0 setup very carefully and got a bit frustrated when I got an invalid_client error... until I realised it was because I had included some white space in the client ID and secret fields! clown

Average of ratings: Useful (2)
In reply to Helen Foster

Re: Google Docs repository and Moodle 2.3 problem

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

So you immediately went and documented it to save others the frustration big grin

In reply to Helen Foster

Re: Google Docs repository and Moodle 2.3 problem

by Huw Smith -

Where did you include the client ID and secret fields?

After activating google docs in Repositories > Google Docs the only setting I can change is plugin name.

I have created a oauth2callback.php in /admin with the client ID and secret field but I get a warning message that "This website has not registered with Google to establish a secure connection for authorization requests." when I try to login to google docs.

In reply to Huw Smith

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -

Hi Huw,

Sounds like you are not using Moodle 2.3?

In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Huw Smith -

Thanks for the reply Dan, I was using 2.3 Alpha. 

In reply to Eric Smith

Re: Google Docs repository and Moodle 2.3 problem

by Bob Puffer -

There's a difference between setting up a client in your domain and enabling API access in your domain though they look similar.  If you are a Google Apps for Education or Business and have enabled API access for your domain the Google repository for Moodle won't work for you because it expects a "client" and Google won't allow you to create a client and allow API access for the same domain or any subdomains for that domain.

In reply to Bob Puffer

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -
Bob,

As discussed in MDL-33585, I would like more information on this issue. If it is a limitation from Google's side then we need to work it out.

Note that (as far as I know) generating an OAuth 2.0 client doesn't need any sort of domain specific tie, you can do it on any google account.

If users with institutional google apps accounts are having problems, i'd love to hear about this in MDL-33585.
In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Bob Puffer -

Posted on MDL-33585 

I realize Moodle developers like having discussions on the tracker but I stand with the community in believing most people aren't going to go to the tracker to have their conversations or view what's taking place in important issues. So here's the cross-post:

Here's the scenario:
1. Google Apps for Educ (or Business) authorizes use of google APIs in their domain (allowing them to program around their on-campus apps using Google APIs -- common)
2. Moodle's Google repo requires setup of a OAuth 2 client on Google's site containing the calling domain. If this domain is a subdomain of the Google Apps for Ed institutional domain (pretty dang likely) Google will not allow creation of the client because for its purposes that domain already has access to the APIs.

In reply to Bob Puffer

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -
As also discussed on the tracker, i've asked that you try using a non-apps for edu account to setup the oauth credentials.

You seem to be having more success with that.

I have emailed the Google OAuth 2.0 mailing list to discover more information about setting up OAuth 2.0 credentials on hosted domains.
In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Dan Poltawski -
Further to this, I have now closed the bug as I do not believe it is a problem with Moodle. If you follow the instructions carefully then you should not have any issues with using the google plugins for hosted google products.
In reply to Dan Poltawski

Re: Google Docs repository and Moodle 2.3 problem

by Bob Puffer -

Yes, thank you Dan, you're correct -- I've learned some things I didn't know about Google Apps.