Unique user identifier

3 views
Skip to first unread message

jonas

unread,
Oct 6, 2010, 10:19:04 AM10/6/10
to dyuproject
Hi,

what is the recommended way of getting a unique user id after a login?
There are a few diffrent functions in the OpenIdUser that has to do
with identifiers,
I'm not really sure what to use.

Regards,
Jonas

David Yu

unread,
Oct 6, 2010, 11:25:18 AM10/6/10
to dyupr...@googlegroups.com
Use user.getClaimedId().

When the user has an openid delegate (e.g has his own site as identifier and delegates the openid to another site), the claimedId will 
be the identifier.

When the user provides a unique identifer from his provider (e.g user.myopenid.com), the claimedId will 
be the identifier.

When the user provides a generic identifier (google/yahoo), the claimedId will be the openid.identity provided by the OP since its a generic identifier.

The value of user.getIdentifier() and user.getClaimedId() will be the same except for last case.

The advantage of using user.getClaimedId() is the first case.  When your user changes his openid delegate, he doesn't need to re-register from your site.  
Otherwise he will have to re-register if you used user.getIdentity() since the openid identity has changed due to changing delegates.

Cheers


--
You received this message because you are subscribed to the Google Groups "dyuproject" group.
To post to this group, send email to dyupr...@googlegroups.com.
To unsubscribe from this group, send email to dyuproject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dyuproject?hl=en.




--
When the cat is away, the mouse is alone.
- David Yu
Reply all
Reply to author
Forward
0 new messages