views:

2384

answers:

6

I'm using JanRain's PHP OpenID library. It comes with example script which is using SReg extension. But I want it to work with Google (and it works for auth actually), but Google uses AX (attribute exchange) instead of SReg for additional data. For some reason, JanRain's library is missing AX support in example script, and code comments in AX script are out of my understanding, though comments in SReg script are clear as 1-2-3.

Does anyone know how to implement AX without too much pain?

+18  A: 
What can I say? It's working perfectly! Many thanks!
Supercharged
excellent post, thanks a lot man. you saved me too..
Gaurav Sharma
how do I make it work with yahoo also..? Please help.thanks
Gaurav Sharma
Simson, it would be handy if you could go back and make the corrections to your answer suggested below. (The consumer->complete line is also missing a ' which shows up in the syntax highlighting :)
crb
i would give you +100 if i could
luca
+4  A: 

The request half is working, however I am getting failure in the Catch.

Should the line above

$auth = $consumer->complete('http://localhost:4001/oid_catch.php);

be

$response = $consumer->complete('http://localhost:4001/oid_catch.php);

Otherwise, where does the response object come from? I am not getting returned the openid.current_url in my response to check the url with?

Paul
You've probably solved this long ago, but for others, note the lack of closing quote there.
joedevon
+1  A: 

You are, of course, correct. The variable $response should be populated, not $auth. As I said, the code has not been de-bugged. Sorry.

A: 

Hello Friend,

Could you send me the code for google for openid Oauth.my email id is [email protected]

Amit
A: 

thanks alot Simson,it helps me alot about Google.but what can i do for Yahoo? it doesn't return anything with this code

hd
A: 

Problem for Yahoo is solved !!! check out here: http://stackoverflow.com/questions/2616123/php-openid-doesnt-work-with-yahoo/2620558#2620558

hd