Delegate domain-wide authority to your service account
Steps
-
From your domain's Admin console, go to Main menu > Security > Access and data control > API controls.
-
In the Domain wide delegation pane, select Manage Domain Wide Delegation.
-
Click Add new.
- In the Client ID field, enter the client ID obtained from the service account creation steps above
-
In the OAuth Scopes field, enter a comma-delimited list of the scopes required for the application
-
Use the below scopes:
- https://www.googleapis.com/auth/admin.directory.user.readonly
- https://www.googleapis.com/auth/admin.directory.domain.readonly
- https://www.googleapis.com/auth/admin.directory.group.readonly
- https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
-
Click Authorize.
Required scopes
- DirectoryService.Scope.AdminDirectoryUserReadonly
- DirectoryService.Scope.AdminDirectoryDomainReadonly
- DirectoryService.Scope.AdminDirectoryGroupReadonly
- DirectoryService.Scope.AdminDirectoryRolemanagementReadonly