0

The Directory API throws a 'Not Authorized to access this resource/api' error when I try to list the groups in a domain as a non-admin. But gmail autocompletes the group names (which means it is able to retrieve the list of groups) for non-admin users as well. Is there a way to get the list of groups or search from the list of groups in a domain without being an admin?

1 Answers1

1

The best way to do if you are not an admin user, is to impersonate the admin by using a service account. You need to enable domain-wide delegation for your service account to impersonate a domain admin when making a request. See this SO post and another discussion for this github post.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65
  • Thanks! I get the idea, but my question is - is there any other way out? (apart from being or impersonating the admin) Some other API perhaps? – Vignesh Bayari R. Jan 25 '19 at 08:12