views:

73

answers:

1

Using OpenID auth, which is the proper User instance method to get a unique identifier useful for creating and identifying a user on Datastore as key_name?

Available methods :

nickname() For OpenID users, the nickname is the OpenID identifier.

federated_identity() Returns the user's OpenID identifier.

federated_provider() Returns the URL of the user's OpenID provider.

On user logins i would like to retrieve it by:

User.get_by_key_name(key_used_to_create_the_user)
+1  A: 

You will probably want to generate your own user ID for within your system so that users can change their OpenID providers (or even have more than one OpenID associated with their account, which many sites support). But if you did want to use the OpenID as a unique key for some reason, I think federated_identity() is the one you want (just from reading the docs, I have never used this library). You want their full OpenID URL, which is guaranteed to be unique -- this includes both the provider portion of the URL and the "username" portion (which maybe be a "subfolder" or subdomain, etc). Sorry I've forgotten the technical terms... been a while since I used OpenID.

rmeador