1

I am trying to run the sample Google Apps Script Service Account OAuth example taken from here: https://github.com/googlesamples/apps-script-oauth2/blob/master/samples/GoogleServiceAccount.gs and keep getting a server timed-out error. I copied the exact code and just substituted in the private key, client email, and a user email. The example code looks to be current as there was an update to it on July 30th.

I have authorized https://www.googleapis.com/drive/v2/files through the admin console as well as https://accounts.google.com/o/oauth2/token and have listed these as scopes in the admin settings (and domain-wide delegation is enabled). I am using an admin account to run the script.

I keep getting the ubiquitious "Server Timed Out" error and nothing shows up in the Execution Logs.

What might be the problem? Any help would be appreciated. Thanks in advance.

  • Did you followed all the instructions to set the project? it is also mentioned that you can copy the files in the /dist folder into your project. did you also tried doing so? – Gerardo Oct 05 '15 at 18:23
  • Yes I did. I was using the library, but I copied and pasted the contents of /dist into my project and got the same result. I also changed the scope for drive to https://www.googleapis.com/auth/drive (as I believe this is the correct syntax for that scope), and that did not fix it either. – Adrian Rakochi Oct 06 '15 at 14:24
  • Could it be a problem with the apps script project? I followed the same steps and was able to run the example without problems. maybe creating a new apps script project and following the steps again could solve the problem. – Gerardo Oct 06 '15 at 22:33

1 Answers1

0

Thanks, Gerardo, for pointing me in the right direction. It turned out that our organization manages permissions for the Google Developer's Console by Organizations (in the Google Admin console). Somehow a few accounts, including mine, were kicked out of the Organization that had permissions to access the Developer's Console. After adding myself back in, the sample worked without problems.