phpopenidgoogle-oauthgoogle-openidlightopenid

Google login works on localhost but not on online domain


I am using lighopenID https://gitorious.org/lightopenid which works fine at my local host. And always validates:

include 'openid.php';
$openid = new LightOpenID('localhost');
$checkvalidation = $openid->validate();

But when I made the code online and as per the documentation I replaced localhost with my domain name domainname.com then it keeps on giving me this error:

OpenID auth request contains an unregistered domain: http://domainname.com

Kindly let me know how can I fix this issue?

include 'openid.php';
$openid = new LightOpenID('domainname.com');
$checkvalidation = $openid->validate();

Solution

  • Don't use OpenID, use OAuth 2 instead. As you can read here, Google has deprecated the OpenID 2 API and closed registration to new clients in May 2014.