ERROR: Service Account oAuth 2 file: Does not exist or has invalid format

6 views
Skip to first unread message

Christopher Alpaugh

unread,
Feb 1, 2026, 8:11:21 PM (15 hours ago) Feb 1
to GAM for Google Workspace
Hello!

I have been trying to configure a new installation on Windows 11 following the instructions.

If i type the following comment:

c:> gam user <myemail> check serviceaccount

I get the following:

ERROR: Service Account OAuth2 File: C:\GAMConfig\oauth2service.json, Does not exist or has invalid format, Unable to load PEM file. See https://cryptography.io/en/latest/faq/#why-can-t-i-import-my-pem-file for more details. MalformedFraming
Please run

gam create|use project
gam user <user> update serviceaccount

to create and authorize a Service account.


I have tried this, and nothing helps.  I have followed the direction to authorize service account key uploads.  

Running "gam oauth create" appears to complete as expected:

The authentication flow has completed.
Client OAuth2 File: C:\GAMConfig\oauth2.txt, Created

However I cannot do any gam commands. I always get the "ERROR: Service Account OAuth2 File" error. 

What's the soluiton? 

thx

Christopher

Christopher Alpaugh

unread,
Feb 1, 2026, 9:56:43 PM (13 hours ago) Feb 1
to GAM for Google Workspace
I noticed i don't get any values for "Private_key" or "priavet_key_id" in my oauth2service.json file.

I have followed all the steps to "authorize Service Account key Uploads".

but i cannot seem to get this installation working at all.

Christopher Alpaugh

unread,
Feb 1, 2026, 10:16:06 PM (13 hours ago) Feb 1
to GAM for Google Workspace
ok. i think i finally got it going. I didn't wait long enough after correcting the "iam.managed.disableServiceAccountKeyUpload" organization policies.

Everything seems to be workign now. 


On Sunday, February 1, 2026 at 5:11:21 PM UTC-8 Christopher Alpaugh wrote:
Reply all
Reply to author
Forward
0 new messages