TokenResponseException: 401 Unauthorized Exception when trying to access Admin SDK Google API.

后端 未结 4 753
遇见更好的自我
遇见更好的自我 2021-01-24 05:34

I am trying to do an extract of users in my domain by accessing the Google Admin SDK API. I am however given a 401 unauthorized exception. The code below is my settings class th

4条回答
  •  無奈伤痛
    2021-01-24 06:18

    I was running into this same issue when trying to use the Admin SDK Google API with a service account.

    The issue was occurring for me because the Scopes that were set in my code did not match those set at my Google Admin Console under "Security > Advanced Settings > Manage API client access". Once these were aligned it all started working perfectly.

    You also are required to have Domain Wide Delegation on for your service account? (This can be done here)

提交回复
热议问题