Using a service account, I'm impersonating users (non-service accounts) in my domain, and subscribing to the Watch API of their primary calendar.
Google is returning the same resource ID for each user's calendar, as well as the same sync token. Is this expected?
This is how I get the credentials of the DWD'd user:
private GoogleCredentials getDelegatedCredentials(List<String> scopes, User impersonatedUser) throws IOException {
GoogleCredentials credentials = GoogleCredentials.getApplicationDefault()
.createDelegated(impersonatedUser.email())
.createScoped(scopes);
credentials.refresh();
return credentials;
}