Common parameter to retrieve email address from OpenID provider

妖精的绣舞 提交于 2019-12-10 19:08:38

问题


In my site, I am using authentication based on OpenID. I am requesting 'email address' from the OpenID provider. The problem is each provider is sending the email address in their own parameter in GET response after authentication. I am listing down three of what I have seen

StackExchange

openid_alias3_value_alias1

Yahoo!

openid_ax_value_email

Google

openid_ext1_value_email

It is difficult (and not standard) to write separate lines of code for each OpenID provider. Is there a standard for this?

(added a bug : https://meta.stackexchange.com/questions/106922/stackexchange-openid-parameter-for-email-should-be-openid-ax-value-email)


回答1:


As there's no identifier like openid.email defined in the Positive Assertions section of the OpenID Auth 2.0 specs, I'd say: no, there is no such standard.

OpenID supports extensions to carry extra data like email, but it's completely up to the OpenID provider which data to reveal (if any at all), what identifiers to use and where to place them in their extension namespace hierarchy.



来源:https://stackoverflow.com/questions/7497943/common-parameter-to-retrieve-email-address-from-openid-provider

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!