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.
--
When the cat is away, the mouse is alone.
- David Yu