1

I am building a Chrome web extension app that will allow me to check whether all users in some Google workspace have some settings enabled.

I am not the owner of any of these workspaces, so I will need permission from the workspace admins.

I have created a base chrome app, and am able to load it into chrome. I have used chrome.identity.getAuthToken({interactive:true}, function(token) { ... } to retrieve an OAuth token from the user using the extension.

My intention was to use this OAuth token to access the google Admin SDK and use the GET https://admin.googleapis.com/admin/reports/v1/usage/users/{userKey or all}/dates/{date} API call to retrieve the information on user settings, which can be found under the accounts reports. [link]

However, I am unsure as to how I can use the retrieved OAuth token to access this API.

Is the Admin SDK the best way to go about retrieving this data? If so, how do I get access to the Google workspaces using this token?

  • Are you creating the extension so the Admins can retrieve the information from their own GW accounts? The Admin SDK only allows Admins from their own domain to retrieve data so it would not be something that can be done without being an Admin on their side. – Gabriel Carballo Feb 21 '22 at 22:01
  • @gabriel-carballo what he is trying to do is to get access to another admin's workspace and check that workspace's user settings – OneMoreQuestion Feb 21 '22 at 22:50
  • @GabrielCarballo, OneMoreQuestion is right, I am trying to get access to another admin's workspace – Felipe Delclaux Feb 21 '22 at 23:08

1 Answers1

0

The Admin SDK is used by Admins only due to the type of data that is handled by this API, if you are trying to get information from other users you will need to find a way to impersonate a Super Administrator as regular users won't be able to perform the API call to UserUsageReport.get().

You can use a Service account for user impersonation, there is a good example of how you could work on by using a service account in the following thread however this is made in nodeJS but you will get the idea.

Gabriel Carballo
  • 1,278
  • 1
  • 3
  • 9