Directory API. => "User does not have credentials to perform this operation" even though user is a delegate admin

22 views
Skip to first unread message

Samarth Manwani

unread,
Mar 22, 2024, 9:58:52 AM3/22/24
to Google APIs Discovery Service Users
Hi 
I am trying to fetch  user tokens from the admin directory
https://developers.google.com/admin-sdk/directory/reference/rest/v1/tokens/get

but the API randomly throws following error for some users 

Bearer token is obtained from the OAuth flow, user who granted the oauth consent has
1. granted access to necessary scope
2. is a delegate admin
3. has read access to security settings from the API

{
"error": {
"code": 401,
"message": "User does not have credentials to perform this operation",
"errors": [
{
"message": "User does not have credentials to perform this operation",
"domain": "global",
"reason": "authError",
"location": "Authorization",
"locationType": "header"
}
]
}
}

please help

Thanks
Reply all
Reply to author
Forward
0 new messages