Hi
I am trying to fetch user tokens from the admin directory
https://developers.google.com/admin-sdk/directory/reference/rest/v1/tokens/getbut 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