I successfully figured it out!
To determine if you purchased a Google Apps domain on it, follow these steps:
Make a CURL request: " https://www.google.com/a/ {domain} / ServiceLogin"
Look for the following line: " Unfortunately, you have reached the login page for a domain that does not use ", if it contains this line, it does not have Google Apps, if it does not have this line, except for Google Apps.
PHP function example (I use file_get_contents instead of CURL in this example because it is shorter, note that you will need to allow allocation based on the URL in php.ini)
function lookupGoogleAccount($domain) { $url = "https://www.google.com/a/$domain/ServiceLogin"; $extpage = file_get_contents($url); $not_gapps = strpos($extpage,"Sorry, you've reached a login page for a domain that isn't using"); return !$not_gapps; }
Example: https://gapps.qk.com.au/?domain=never.io
Using this method, even if the domain is a reseller and uses a custom SSO solution, it should continue to work.
source share