views:

526

answers:

3

i am trying to use php-openid library for implementing openID in my site. the basic consumer example inside its package doesn't work for Google and Yahoo. i found the Google solution here: http://stackoverflow.com/questions/1183788/example-usage-of-ax-in-php-openid/2612816 but it doesn't still work for Yahoo! . how can i made it works?

+3  A: 

wow it is solved now !!!!!

i traced the functions and found the problem.and that is.... in "try_auth.php" file i used

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email');" 

for getting the user email from provider. it works fine in Google because Google ignore '2' (count of requested email address) but in Yahoo! it generate [count.email] => 2 for it (in getSignedNS function) and in Yahoo response there is no entry for count.email. it causes to return null in getSignedNS for Yahoo. i changed

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',2,1, 'email');"

to

"$attribute[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email',1,1, 'email');" 

and it works fine now and return whatever i requested from both provider !!!

lol...

hd
A: 

Perfect, it works! Thanks dude, you helped me a lot.

Teja
nice to hear that.
hd
A: 

Thanks a lot. I really helped.

Mark