List of Google directory users from the application

I am creating an iOS application for internal use. We have a Google domain. As part of the functionality of the application, I want to be able to search for all users in this domain. This can already be done in Gmail, the Apple Mail application and others.

I found that you can use the admin SDK for users.list to do exactly what I want to do. I created a client identifier for the iOS application and allowed my application to execute users.list .

Permissions in the developer console

However, now I get a permission error for users who sign up using OAuth2:

An authorized OAuth user does not have the right to specify users

I found that you can create a service account to make API requests on your behalf if you delegate it to gain authority. I'm not sure if this is what I want to do, as it looks like something for a secure server, not an application. I'm also not sure how this integrates with a user (from our domain) who signs up with OAuth to display our users.

Is it possible to list / find users in a Google domain only through the OAuth / frontend application?

+5
source share
1 answer

Besides caching my own list, I think there are two ways to give users the ability to list all users:

a. An undocumented call to this GAL API: https://www.google.com/m8/feeds/gal/your-domain-goes-here/full?alt=json ( source ). You can check this on the Google OAuth Playground by selecting the area for the V3 Contacts API or using the line https://www.google.com/m8/feeds/ .

B. In the admin console, create the "all users" group. Assign the newly created administrator role. Provide the admin role to read in privileges> API privileges API> Users> Read (marked).

+1
source

All Articles