用于从OpenID提供程序检索电子邮件地址的通用参数 [英] Common parameter to retrieve email address from OpenID provider

查看:122
本文介绍了用于从OpenID提供程序检索电子邮件地址的通用参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的站点中,我正在使用基于OpenID的身份验证.我正在从OpenID提供者处请求电子邮件地址".问题在于,每个提供者在身份验证后都会在GET响应中使用自己的参数发送电子邮件地址. 我列出了我所见过的三项

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

openid_alias3_value_alias1

Yahoo!

openid_ax_value_email

openid_ax_value_email

Google

openid_ext1_value_email

openid_ext1_value_email

很难(不是标准)为每个OpenID提供程序编写单独的代码行. 有这个标准吗?

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)

推荐答案

由于 OpenID支持扩展来携带诸如email之类的额外数据,但完全由OpenID提供者决定,要显示哪些数据(如果有的话),要使用的标识符以及将其放置在扩展名称空间层次结构中的位置.

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.

这篇关于用于从OpenID提供程序检索电子邮件地址的通用参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆