Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Directory API - 403 [Not Authorized to access this resource/api] on one machine, works on another

I've been testing my authorization code and suddenly I started to get:

Not Authorized to access this resource/api [403]
Errors [
    Message[Not Authorized to access this resource/api] Location[ - ] Reason[forbidden] Domain[global]
]

I scratched my head and tried a few things but I didn't think I'd changed anything. Eventually I tried running it on a different machine. It worked without error.

I'm using v1.6 of the Google Directory API .NET Client. I've been working on this for a while. I had service authorization working and was working on client authorization when I experienced the issue. I'm currently getting the same error when I try authorizing with service creds. I'm not currently in a position to check if that process still works on the other machine.

Any ideas?

EDIT

I'm using the same ClientId on the two machines.

like image 338
Simon Avatar asked Sep 04 '25 16:09

Simon


1 Answers

I was getting a 403 error as well. I resolved it by correcting the permissions. I had the project setup into Google under [email protected]:

  1. I had to login as our super user into Gmail
  2. search for user xyz
  3. I selected the user, then pressed Show more
  4. I clicked on 0 Admin roles and privileges
  5. enabled "User Management" since I was trying to pull a list of users

And the error went away.

like image 59
A Ruffian Avatar answered Sep 07 '25 19:09

A Ruffian