Php – Janrain php library and google endpoint for OpenId

janrainopenidPHPzend-framework

Im using janRain Php library for OpenId and yadis discovery and no matter what i do, i will work in stuff like user.openid.org or my own provider, but if i try to use the google endpoint, i cant get any discovery information.

Even if i run the discovery example for the janrain library, i get the next result Claimed

Identifier  http://www.google.com/accounts/o8/id
No OpenID services discovered.

and it happens the same if I add the https:// before the url.

My question is probably not how to make it work, but if its actually possible, what other choices do i have (that run in my site, no sassy auth wanted in the project).

Why is openId so #@!#@ complex and undocumented?(note, i gave zend_openid a couple of hours to have the same result)

Best Answer

it's working here. some hints:

  • as i understand it, http(s)://www.google.com/accounts/o8/id is not an openid endpoint, but googles discovery endpoint. you have to supply it a valid (google) OpenID Identifier, like example.blogspot.com, for which it returns Claimed Identifier, Server URL, Service types, etc.
  • i got the discovery example only working after fixing the <? and <?= in discover.php (replacing them with <?php and <?php echo). alternatively, you can ini_set('short_open_tag', '1'). it's off by default in php.ini-recommended.
  • does your PHP installation support SSL? see README, specifically this part:
Not all PHP installations support SSL.  You can find out if yours
supports SSL by reading the "HTTP Fetching" section of the output of
"examples/detect.php."  If your installation does not support SSL,
then https:// identity URLs and server URLs will not be supported by
the library.  An attempt to use such an identity URL will be
equivalent to using an invalid OpenID.  To enable SSL support,
recompile PHP with OpenSSL support or install the appropriate OpenSSL
module for your platform.  If you are using CURL, CURL will need to be
built with OpenSSL support.