Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

I got issue "unauthorized_client" when using Google APIs Client Library

Hi guys,

I'm currently get an issue "unauthorized_client": Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scope requested.

Below are all the thing I have done in my workspace:
- Enable Admin SDK
- Create a Service Account
- Create new key with "Enable Google Workspace Domain-Wide Delegation"
- All the scope I use are: https://www.googleapis.com/auth/admin.directory.customer.readonly, https://www.googleapis.com/auth/admin.directory.device.mobile.readonly, https://www.googleapis.com/auth/admin.directory.domain.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/apps.licensing, https://www.googleapis.com/auth/userinfo.email

When I tried to authenticate with the service account, I got that issue above. So my question is: Is there anything in the workspace/console configuration that make it block the authentication?

Note that I also created a brand new workspace and tried all the steps above, and it work properly so I'm not sure what is wrong in my current workspace. Please help!

Thanks

3 4 5,061
4 REPLIES 4
Top Labels in this Space
Top Solution Authors