lithnet / googleapps-managementagent

Google Workspace Management Agent for MIM 2016
MIT License
12 stars 4 forks source link

Google Contacts API derpecation (perhaps) questions #82

Open SirDester opened 3 weeks ago

SirDester commented 3 weeks ago

Hello Ryan, I hope youre fine. I'm asking you some information about the Google Contacts API (and the replacemement People API). As I see the Contacts API should have been deprecated some time ago (beginning of 2022) and I was asking if you have plans to migrate the Lithnet GoogleMA connector to the new People API.

I'm also asking this because I have a quite strange behaviour in our infrastructure that syncs Contacts to Google, and I can't find a one way explanation. We double checked the service account permissions on the workspace project and they seems fine.

The majority of exports (adds or update) are failing with the "Forbidden" error like the ones in the logs below. What is making me mad is that they're not "ALL" failing, every sync some of them are exported successfully. And moreover the import task is always completed with no errors.

I think "If the source of error is the deprecation of the API they should ALL fails, not not only most of them"

immagine

An exception has occurred in PutExportEntry
Type: Google.GData.Client.GDataRequestException

Message: Execution of request failed: https://www.google.com/m8/feeds/contacts/xxx/full/xxx/xxx
Source: Google.GData.Client
TargetSite: Void Execute()
<... omitted stacktrace ...>
Inner exception details
Type: System.Net.WebException
Status: ProtocolError

Message: The remote server returned an error: (403) Forbidden.
Source: System
TargetSite: System.Net.WebResponse GetResponse()
<... omitted stacktrace ...>
An exception has occurred in PutCSEntryChangeAdd
Type: Google.GData.Client.GDataRequestException

Message: Execution of request failed: https://www.google.com/m8/feeds/contacts/xxx/full
Source: Google.GData.Client
TargetSite: Void Execute()
<... omitted stacktrace ...>
Inner exception details
Type: System.Net.WebException
Status: ProtocolError

Message: The remote server returned an error: (403) Forbidden.
Source: System
TargetSite: System.Net.WebResponse GetResponse()
<... omitted stacktrace ...>

Do you have any idea of what is going on ?

Thanks in advance Maurizio.

SirDester commented 2 weeks ago

I just read better the Contacts API documentation and perhaps I was wrong about de deprecation cause, because I was confusing Personal Contacts (that are depreacted with the APIs) with the Domain Shared Contacts (that are not deprecated with the API you use in the lithnet MA code).

immagine

So I think that the issue is to be addressed with Goolge support that should tell us why so many requests fails with Forbidden error (and sometimes Too Many Requests error).

ryannewington commented 2 weeks ago

Hi @SirDester

Sorry for the late reply. Yeah domain shared contacts isn't part of that deprecation. But it's a really old API and works very differently to the rest of the directory API and has always been a bit fragile.

If you do get answers from Google as to what's going on in the back end, let me know and if there's anything we can adjust to help we will do so.