java-samples icon indicating copy to clipboard operation
java-samples copied to clipboard

Alert Center API Error: 401 Unauthorised

Open Baldur10 opened this issue 4 years ago • 0 comments

Sample Name

Alert Center API Quickstart

Expected Behavior

Retrieval of Alert Center Alerts after a successful API call

Actual Behavior

Exception in thread "main" java.io.IOException: Error getting access token for service account: 401 Unauthorized

Specifications

  • Java version ('16')
  • Windows
  • Apache Maven version 3.6.3

Hello. I have been trying to build a script to retrieve Alert Center Reports using a service account authorized to access the domain. Upon running the script, I seem to be running into the aforementioned error inspite of granting domain wide delegation and permission to access the scope (https://www.googleapis.com/auth/apps.alerts) to the said service account. The credentials.json file seems to be up to date for the service account as well.

Here you can view the error message and assorted info.

Baldur10 avatar Apr 12 '21 01:04 Baldur10