Mewp / lightopenid

Automatically exported from code.google.com/p/lightopenid
MIT License
4 stars 12 forks source link

Not getting unique Google ID on $openid->identity #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just implemented this so I'm not sure if I'm understanding correctly, but 
from the example, it looks like to get Google's unique identifier for the user, 
you do:

$openid->identity;

When looking at the code in get's magic method:
return $this->claimed_id;

But if I var dump $this, the id is stuck at the end of (where XXXX's are):
[data][openid_claimed_id] => https://www.google.com/accounts/o8/id?id=XXXXXXX

whereas

 [claimed_id:private] =>

is empty....

I hope that makes sense? On Google's documentation:

http://code.google.com/apis/accounts/docs/OpenID.html

they state that they provide a unique ID, this way even when a user changes 
their name, we can be sure to uniquely identify them...Here's the exact quote:

"The Google-supplied identifier, which has no connection to the user's actual 
Google account name or password, is a persistent value; it remains constant 
even if the user changes their Google user name and/or email address. This 
identifier is also a "directed identity", that is, Google returns a different 
value to each relying party. Google uses the request parameter openid.realm to 
recognize the relying party, so if the third-party application decides to 
change this value, all user identifiers will change."

BTW this id seems identical in their example:

&openid.identity=https://www.google.com/accounts/o8/id/id=AItOawl27F2M92ry4jTdji
Vx06tuFNA

&openid.claimed_id=https://www.google.com/accounts/o8/id/id=AItOawl27F2M92ry4jTd
jiVx06tuFNA

Original issue reported on code.google.com by joede...@gmail.com on 1 Oct 2010 at 11:24

GoogleCodeExporter commented 9 years ago
Just one question:
Does $openid->identity not return valid value for you? I've just tested the 
example, and it works fine for me(and it does return claimed_id), so I can't 
reproduce the problem.

$this->claimed_id is set at the beggining of validate() function. Before 
calling it, you shouldn't read $openid->identity at all (since an unverified 
identity is worthless).

Original comment by mewp...@gmail.com on 2 Oct 2010 at 10:14

GoogleCodeExporter commented 9 years ago
Oops, heh heh, my bad. 

Thanks!

Original comment by joede...@gmail.com on 2 Oct 2010 at 4:54

GoogleCodeExporter commented 9 years ago

Original comment by mewp...@gmail.com on 2 Oct 2010 at 6:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
but how to get userid with $openid?
ps: i want to get avatar of user gooogle by $openid

Original comment by huydung...@gmail.com on 18 Feb 2014 at 4:11

GoogleCodeExporter commented 9 years ago
This is a bugtracker, not a place to ask questions.

I'd suggest reading a bit about OpenID itself (so that you know why there's no 
such thing as "userid", other than `$openid->claimed_id`), and then, if you 
still have questions, asking them on StackOverflow (or somewhere else if you 
like).

That will make it easier for other people to find the answer to your, and 
similar questions, not to mention that more people will see and possibly answer 
them.

Original comment by mewp...@gmail.com on 18 Feb 2014 at 6:51