OAuth2 Scripting Support for Service Accounts

Does the API directory support authentication using OAUth2 account flow?

I tried serviceAccount.php google-php-api-client using areas https://www.googleapis.com/auth/admin.directory.group and https://www.googleapis.com/auth/admin.directory.user and he didnโ€™t work.

+4
source share
2 answers

You need to authorize the service account client ID in order to access these areas of the API in the Google Apps control panel. See Step as described in Drive Drive Documents , just falls within your SDK administration area.

Please note that IMHO, there are very few benefits of using a service account with Directory / Reporting APIs, since you still need to impersonate a user who has super-administrator (or proper delegated admin) roles to execute and make API calls. It makes sense for me to simply get the three-legged OAuth 2.0 update token, which supports offline communication with the administrator. 3-legged can be executed completely programmatically, where, since service accounts require a manual step above.

+1
source

Short answer: Yes . The @emilylam comment question alludes to a mistake.

0
source

Source: https://habr.com/ru/post/1483866/


All Articles