Switching to secondary domain always triggers API access denied

22 views
Skip to first unread message

Jing Admin

unread,
Sep 30, 2025, 12:42:59 PM (5 days ago) Sep 30
to GAM for Google Workspace
Hello,

I must be doing something wrong with secondary domains.

Whenever I enter

gam select domain2 save

and then try any gam command, I get

ERROR: Authentication Token Error - Reauthentication is needed, please run
gam oauth create
ERROR: API access Denied

I can run this but it's annoying that it happens every time. It's possible that there's a timeout that I haven't set correctly because I think it's fine if I run oauth create and then switch back and forth in the same session.

I don't get this with the default domain though, even if I don't use it for several days.

I have gam.cfg set this way:

default = .gam/
domain2 = .gam/domain2

What am I doing wrong?

Thanks!

Ross Scroggs

unread,
Sep 30, 2025, 12:50:39 PM (5 days ago) Sep 30
to google-ap...@googlegroups.com
See: https://github.com/GAM-team/GAM/wiki/Authorization#introduction
Scroll down to
Based on your domain policies, you may have to mark GAM as a trusted app. These steps are performed after a project is created.
Verify whether the super admin you'll be using is in an OU where reauthentication is required.

Send me a private Meet/Zoom invitation if you need help,

Ross
----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/ca4062a6-0144-4ed2-ad30-5b4e004c1e50n%40googlegroups.com.

Jing Admin

unread,
Sep 30, 2025, 2:11:17 PM (5 days ago) Sep 30
to GAM for Google Workspace
Thanks Ross,

You were right, the default domain is set to never reauthenticate and the secondary was set to reauthenticate every 16 hours.

Both GAM apps are set to Trusted though so why is the "Exempt trusted apps" setting not working?

Thanks!

Jay Lee

unread,
Sep 30, 2025, 3:26:56 PM (5 days ago) Sep 30
to google-ap...@googlegroups.com
If you aren't doing Vault exports, don't select Google Cloud Storage scope. It's what's causing the truth.

Jay Lee

Reply all
Reply to author
Forward
0 new messages