Reputation: 13376
I've created a Google Apps Marketplace app with OAuth2 authentication, and I'm able to use a Service Account to list app installation notifications and to get customer info. However, I couldn't find a way of getting a full list of the users in the domain which my app is installed on.
What I've tried so far is adding the scope for the directory api https://www.googleapis.com/auth/admin.directory.user.readonly
and calling the directory api, but this returns an error: Domain cannot use apis.
How can I list domain users?
Update:
After enabling Admin API in the domain management dashboard, I still get an error: Not Authorized to access this resource/api
. This error doesn't happen when impersonating as the admin user, but I couldn't find a way of getting the admin's username, so I'm still stuck.
Upvotes: 0
Views: 347
Reputation: 6566
You need to enable the admin api in the control panel, see https://support.google.com/a/answer/60757?hl=en
UPDATE :
At install time, setup a Setup Url and catch the admin user there. You can configure this in the appsmarket SDK :
Upvotes: 2