0

In Google Apps, there is always a base/primary organization. But Google Apps can have subdomains and suborganizations both (or combination of those).

We want to be able to identify the currently logged-in user as being part of the overall organization, whether it be the primary org/domain or some subdomain or suborg. But when you get user info or license info, it returns the home domain of the currently logged in user as the ID for their organization. No ID is consistent across all subdomains or suborgs.

I've also tried listing all orgs using the organization apis, but that doesn't seem to work when trying to get the org info of the root org: https://developers.google.com/admin-sdk/directory/v1/guides/manage-org-units

Is there a way, given a particular Google Apps user, to determine what the primary organization is?

The only alternative we have is to treat every domain/subdomain in the Google Apps org as it's own independent org. This is less than ideal because now a Google Apps admin who manages all of their sub-orgs/subdomains in one place in Google will now have to manage a separate organization in our app for each domain in their overall org. This uses up extra resources in our system for creating these additional orgs, but more importantly creates a very confusing organization/user management model.

Chris Beiter
  • 117
  • 1
  • 10

1 Answers1

0

When you look at the Users resource for the two users, compare the customerId attribute. If they match, the two users are in the same Google Apps account. If they don't they're not.

Also, don't assume two logged in users are in the same Apps account. One could be an Apps account and one could be a consumer account even though they have the same SMTP domain.

Jay Lee
  • 13,415
  • 3
  • 28
  • 59
  • I am not comparing 2 users to see if they are in the same org. I'm trying to find the root/base/parent org for a given Google Apps user so I can bucket them along with other users of the same top level org. The technique you mention doesn't help solve that because it only provides the child organization via the customerId, not the parent org. For example, I have an org with 2 different domains, and a user in each domain. The customerId attribute returns the home domain as part of the customerId, not the base/parent org's domain. – Chris Beiter Mar 18 '15 at 22:00