Google Admin sdk directory 403

前端 未结 1 1296
夕颜
夕颜 2021-01-25 19:50

I\'m trying to use googleapi 2.0 with service account to use Directory gooogle admin sdk on user on an entrprise domain. I\'ve proceeded as suggested (this for instance) and pre

相关标签:
1条回答
  • 2021-01-25 20:08

    Take a look at Google's docs on using service accounts with Admin SDK for domain-wide delegation.

    • You didn't mention it, but you definitely need to grant the service account's client id access to the Admin SDK scopes from your Google Apps Control Panel.

    • Your code is missing a line like .setServiceAccountUser(userEmail) which allows the service account to impersonate a user in your Google Apps domain who has rights to search the directory (probably a super admin user).

    0 讨论(0)
提交回复
热议问题