GAM Verification Code, so I can get started

340 views
Skip to first unread message

Marian O'Hare

unread,
Sep 4, 2014, 3:17:10 PM9/4/14
to google-ap...@googlegroups.com
I am a first time user of GAM, trying to get it configured.
I have created the client_sercrets.json and downloaded it to the gam.exe folder
 I am stuck at entering the verification code.

When running gam info domain I then selected to continue and entered 21 to continue again
However after clicking 21 
Error states:
Go to the following link in your browser:


Enter verification code:

When trying to access this URL I get Error message:

401. That’s an error.



Error: invalid_client

no application name


Request Details
response_type=code
scope=email https://www.googleapis.com/auth/admin.directory.group https://www.googleapis.com/auth/admin.directory.orgunit https://www.googleapis.com/auth/admin.directory.user https://www.googleapis.com/auth/admin.directory.device.chromeos https://www.googleapis.com/auth/admin.directory.device.mobile https://apps-apis.google.com/a/feeds/emailsettings/2.0/ https://apps-apis.google.com/a/feeds/calendar/resource/ https://apps-apis.google.com/a/feeds/compliance/audit/ https://apps-apis.google.com/a/feeds/domain/ https://www.googleapis.com/auth/apps.groups.settings https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/admin.reports.audit.readonly https://www.googleapis.com/auth/admin.reports.usage.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/apps.licensing https://www.googleapis.com/auth/admin.directory.user.security https://www.googleapis.com/auth/admin.directory.notifications https://www.googleapis.com/auth/siteverification https://mail.google.com/
access_type=offline
redirect_uri=urn:ietf:wg:oauth:2.0:oob
approval_prompt=force
include_granted_scopes=true
client_id=xxxx.com (I xxx this incase this was sensitive.  This is the same CLIENT ID that was created when I created the Project for the json file)


That’s all we know.

I can't figure out where I went wrong, any ideas?  Thanks 

Ryan K

unread,
Sep 15, 2014, 5:25:15 PM9/15/14
to google-ap...@googlegroups.com
Hi Marian,

While I don't believe I encountered the same error that you did, I came across something similar. I just couldn't get verification to work with IE. I installed Chrome, and copy-pasted the URL into Chrome. This seemed to get the verification to go through.

Perhaps try that and see if it helps?

Ryan K

unread,
Sep 15, 2014, 5:29:39 PM9/15/14
to google-ap...@googlegroups.com
Actually, someone else posted the answer which I believe I had to do as well:

Michel Fasen 
Aug 21
Before downloading the json file you need to go to "APIs & auth -> Consent screen" and complete the "Product name" field. It's an essential step missing from the documentation a long time now.

I believe doing the above will get you sorted out.


On Thursday, September 4, 2014 12:17:10 PM UTC-7, Marian O'Hare wrote:

Marian O'Hare

unread,
Sep 16, 2014, 8:22:39 AM9/16/14
to google-ap...@googlegroups.com, google-ap...@googlegroups.com
What I ended up doing to filter suspended users that have never logged in:

I extracted all fields for all users with the following command:

gam print users allfields >allfields.csv

I then sorted the Suspended Users: True
and the LastLoginTime: Never   using excel commands

Within excel I had one column that had gam delete user

second column was the suspended username.

I then merged the 2 columns in excel

Copied the contents within the column and ran it from the command prompt

from example:

gam delete user 123abc

I had over 12K users to be deleted so it took a long time but it did complete successfully


Marian O'Hare






Reply all
Reply to author
Forward
0 new messages