title: How to get a CustomerId (or other primary key) for a Google Apps account?
body: <p>When a user logs on to our Marketplace V2 app, we need to know which Google Apps account the user belongs to. </p>
  
  <p>The id_token contains the 'hd' parameter (the domain name), but that's not enough, as a Google Apps account can have multiple domains. </p>
  
  <p>CustomerId seems like a good primary key to match users to the correct Google Apps account. The problem is, it doesn't seem to be included in the id_token. Is there some way to figure out what the CustomerId of a user is. </p>
  
  <p>The Admin SDK would be one option, but in almost all cases, calls to the Admin SDK fail with "Domain cannot use APIs". I read in a previous answer that Google automatically (re-)enables API access when an administrator installs a Marketplace app, but that can't be true because a call to the Admin SDK hardly ever works.</p>
  
  <p>Does anyone have any suggestions on how to get a customerId or other primary key otherwise, or another trick to get the Admin SDK working (without having to instruct people to change their Google Apps Scurity settings, because that pretty much defeats the point of an effortless Marketplace installation).</p>
  
  <p>Thanks!</p>