开发者

Reliable method of getting username or realname from OpenID

开发者 https://www.devze.com 2023-04-01 10:06 出处:网络
The site I am developing supports sign-in with the default SimpleOpenIDSelector providers (the same providers that are listed on stackoverflow login page). While it works for simple sign-ins, my AX-re

The site I am developing supports sign-in with the default SimpleOpenIDSelector providers (the same providers that are listed on stackoverflow login page). While it works for simple sign-ins, my AX-required requests remain unfulfilled. For example, Blogger开发者_如何转开发 does not disclose first/last/friendly name through AX.

How can I ensure that I get a string that is the user's preferred name? What are the possible workarounds or alternatives or standard methods of dealing with this?

I am using the latest python-openid library.


You can not. Since SREG and AX are extensions to OpenID, you can't expect everyone to use it, and therefore you can't be sure that you will get any data back from a provider.

The standard method of handling this is to have a normal registration form with the missing fields. Simply use the SREG/AX data from the provider as a convenience for the user (as if he entered the data manually in your registration form), not as something you should rely on.

0

精彩评论

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