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 2,107
4 REPLIES 4

Hello @luanto ,

I would recommend contacting the Workspace support for in-depth investigation on your account about the concern you are encountering.

Hi Luanto, I'm having the same issue but with calendar scopes. It's strange as the same config is working in 3 workspaces but then in one client workspace we get the error "unauthorized_client: Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.".

I'v gone through Google Workspace settings looking for some global toggle that is blocking this but am yet to find anything.

Cheers.

Hello @kimosabe, how are you? Did you find any solution of the error 'unauthorized_client' related to calendar scopes? 
I am facing the same issue right now. 

Hope you can help! Thanks!

Hi @sarah-smith,

For us it was a suspended user account that was to blame. The error "The user must be signed up for Google Calendar" appeared in one of our other API calls.

Hope that helps.

Top Labels in this Space