Error: The file oath2service.json is missing required keys

830 views
Skip to first unread message

Casey Cotita

unread,
Jan 20, 2016, 2:56:04 PM1/20/16
to Google Apps Manager
So I followed all the instructions here (a couple times, carefully trying to fix this myself): https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile#creating-your-own-oauth2servicejson

I've renamed the requisite file to oauth2service.json, and the file contains:


Also renamed the requisite client_secrets.json, and the file contains:


I have them authorized for the following in the Google Admin Security API section:





Using those, I ran:
gam info domain

It brought up the browser logged in as a Super Admin, I successfully gave it access, it says:

Authentication successful.
Google Apps Domain: wgu.edu
....more lines...

I could then run this command successfully:
c:\gam>gam info user my....@wgu.edu
First Name: Casey
Last Name: Cotita
Is a Super Admin: True
...more lines...

But when I tried this command (and others) to test, I get the following error:
c:\gam>gam user my....@wgu.edu delete messages query filename:pdf
Searching messages for my....@wgu.edu
Please follow the instructions at this site to setup a Service Account.
oauth2servicejson

ERROR: The file c:\gam\oauth2service.json is missing required keys (client_email
, client_id or private_key).

Any suggestions for what to try or what I might be missing?

Ross Scroggs

unread,
Jan 20, 2016, 5:35:51 PM1/20/16
to google-ap...@googlegroups.com
Casey,

Your oauth2service.json file is incorrect. Any button/icon that says download with a servce account downloads a client_secrets.json, not an oauth2service.json.
I've only been able to get an oauth2service.json file at the moment of key creation.
The instructions explain how to get an oauth2service.json if you start from the beginning; if you didn't get the first one successfully, follow these steps.
Log in to the developers console. 
When you sign in, you should be at the Projects screen; click your project name.
This should bring you to Home; click Enable APIs and get credentials like keys.
Click Credentials
At the end of the line that says "Service account keys"; click Manage service accounts
At the end of the line that has your project name; click the three dots and choose Create Key
That's your oauth2service.json after renaming.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/97bed7a2-5bd3-47e4-b6a8-11dc8b3e79e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Casey Cotita

unread,
Jan 21, 2016, 7:10:31 PM1/21/16
to Google Apps Manager
Aha, that was definitely it. It looks like I had successfully created those particular .json files previously but managed to download and grab the wrong ones when it came time to rename. 

Everything is working now, thanks so much for your help!

Casey
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages