Problem

After configuring UserSync with GSuite, it fails giving the following error message:

Scheduled with jobid e5c34258-2ef7-4909-b775-5d40a4dd8362
Building index took 0 milliseconds.
Fetching users failed - unexpected response code Response{protocol=http/1.1, code=403, message=Forbidden, url=https://www.googleapis.com/admin/directory/v1/users?customer=03i0dhfn&maxResults=100}
Sync in connector took 464 milliseconds.
Sync result is FAILED, skipping cleanup.
CODE


Solution

There are some possible reasons for that error:

  • The GSuite user you use to grant the permissions has not the permissions to do so.
    In that case, use a GSuite account that has the permissions, like a GSuite admin account.


  • If you are logged into your personal or another GSuite account in your web browser (e.g. to retrieve your personal Gmail emails), this may interfere when granting the permissions because of cookies.
    In that case, you can open a private/incognito window (or use a different browser) and try again to authorize the connector.