Assuming you included:
https:
in the OAuth area, you can make a request:
https:
If this is a Google Apps account, the "hd" (Hosted Domain?) Parameter will be returned by a call with the Google Apps domain as the value. If this is a user account, be it @ gmail.com or even a potential “conflicting account”, the hd parameter will not be returned. See my example below. admin@jay.powerposters.org is the Google Apps account, and consumer@jay.powerposters.org is the user account. If I created a user user in the Google Apps domain, it would become a conflicting account, and the consumer account would be pushed out of the @ jay.powerposters.org namespace, but this has not happened yet.
For admin@jay.powerposters.org :
GET https://www.googleapis.com/oauth2/v2/userinfo HTTP/1.1 200 OK Content-length: 99 X-xss-protection: 1; mode=block ... { "email": " admin@jay.powerposters.org ", "verified_email": true, "hd": "jay.powerposters.org" }
For consumer@jay.powerposters.org :
GET https://www.googleapis.com/oauth2/v2/userinfo HTTP/1.1 200 OK Content-length: 71 X-xss-protection: 1; mode=block { "email": " consumer@jay.powerposters.org ", "verified_email": true }
source share