Unable to add addtional (4th) domain to GAM

502 views
Skip to first unread message

Matthew Gray

unread,
Nov 9, 2022, 11:06:07 AM11/9/22
to GAM for Google Workspace
Hi Everyone (probably Ross lol),

It's a been a minute since using GAM but I need some help. So, I'm trying to add a new domain (a new client of mine) to GAM. I've done this in the past very easily, however, I'm now encountering the following error:

Access Blocked: GAM can only be used within its organization.  (error 403)

I've gone through fairly extensive research/troubleshooting. I've made the following changes and still cannot access it:

Followed and changed everything listed here: https://github.com/taers232c/GAMADV-XTD3/wiki/Authorization#introduction including setting GAM as a trusted app, making sure Google Console has APIs enabled, etc. 

Here's where I'm not sure what to do. The original domain that I setup GAM with, I no longer have access to. Do I need to remove them since they are considered the default domain? Is this causing an issue when it's trying to generate the oauth file? 

Any help would be appreciated!


Rance Hall

unread,
Nov 9, 2022, 11:19:29 AM11/9/22
to google-ap...@googlegroups.com

Ross and I have worked on this model extensively.

 

For me a stock install of advanced gam is easier, but custom directory options are fine.

 

The tail end of your gam.cfg should look something like this:

 

[customer_name]

domain = <primary google domain>

customer_id = <google customer id>

config_dir = <subdirectory of your .gam config folder>

 

 

 

Then for each stanza like this, make sure your default section above has no entries for these variable names.

 

Then in each subdirectory the gam setup commands to create projects and oauth setup will create these:

 

client_secrets.json

oauth2.txt

oauth2.txt.lock

oauth2service.json

 

 

Then when you need to change google domains you have two choices:

 

  1. Issue a “gam select [customer_name] save” which is what I do
  2. Or you can specify the [customer_name] as a prefix to each gam command.  (not my favorite)

 

Ross:  Did I miss anything important? It’s been awhile since we did this.

 

 

 

From: google-ap...@googlegroups.com <google-ap...@googlegroups.com> on behalf of Matthew Gray <matthew....@gmail.com>
Date: Wednesday, November 9, 2022 at 10:06 AM
To: GAM for Google Workspace <google-ap...@googlegroups.com>
Subject: [GAM] Unable to add addtional (4th) domain to GAM

[EXTERNAL EMAIL]

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/a2c6aadd-eabd-4e7b-ac42-d13b0e718c97n%40googlegroups.com.

Matthew Gray

unread,
Nov 9, 2022, 11:24:40 AM11/9/22
to GAM for Google Workspace
Hi Rance,

my config file is fine. It is as you described below and I've done this for several other domains and each time it has worked. The issue is I'm unable to create the oauth file. After copying over the secrets file and oauth service file, I try to create the oauth file from CMD and this is when I get the error.

Matthew Gray

unread,
Nov 9, 2022, 11:28:21 AM11/9/22
to GAM for Google Workspace
If it is easier to just scrap it all and start from scratch, I can do that. Just wanted to make sure I wasn't missing something (hadn't used game since mid-2021 so there has been a lot of change - NOTE: I did upgrade to the latest version)

Rance Hall

unread,
Nov 9, 2022, 11:40:17 AM11/9/22
to google-ap...@googlegroups.com

If you are sure of your configuration, then try this

 

 

gam update project

gam delete oauth

gam create oauth

gam user <email address> check serviceaccount

Matthew Gray

unread,
Nov 9, 2022, 12:05:16 PM11/9/22
to GAM for Google Workspace
Just to close the loop on this - I worked with Ross and got it resolved.

Resolution was connected to GAM versions/ and using a legacy approach to multi-client for a single project.

On Wednesday, November 9, 2022 at 11:19:29 AM UTC-5 Rance Hall wrote:
Reply all
Reply to author
Forward
0 new messages