开发者

OpenID auth: which method to get a unique identifier to use as key?

开发者 https://www.devze.com 2023-01-12 17:10 出处:网络
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?

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 u开发者_StackOverflow中文版ser'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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号