My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 9: Not getting unique Google ID on $openid->identity
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Oct 2010


 
Reported by joede...@gmail.com, Oct 1, 2010
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:

https://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=AItOawl27F2M92ry4jTdjiVx06tuFNA

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


Oct 2, 2010
Project Member #1 mewp...@gmail.com
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).
Oct 2, 2010
#2 joede...@gmail.com
Oops, heh heh, my bad. 

Thanks!
Oct 2, 2010
Project Member #3 mewp...@gmail.com
(No comment was entered for this change.)
Status: Invalid
Feb 18, 2014
#5 huydung...@gmail.com
but how to get userid with $openid?
ps: i want to get avatar of user gooogle by $openid
Feb 18, 2014
Project Member #6 mewp...@gmail.com
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.

Powered by Google Project Hosting