AZURE ACS - Windows Live ID - 如何获取经过身份验证的用户的电子邮件和姓名? [英] AZURE ACS - Windows Live ID - How do I get the email and name of the authenticated user?

查看:15
本文介绍了AZURE ACS - Windows Live ID - 如何获取经过身份验证的用户的电子邮件和姓名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景如下:

在 AZURE Dev 环境中运行的 MVC 3 应用程序AZURE ACS 中的身份验证采用与此处相同的方式 http://msdn.microsoft.com/en-us/图书馆/hh127794.aspx

MVC 3 application runing in AZURE Dev enviroment Authentication in AZURE ACS implemented the same way found here http://msdn.microsoft.com/en-us/library/hh127794.aspx

我正在尝试获取用户名和电子邮件,但我找不到配置声明规则"的方法,以获取明文值的方式,而是得到一个看起来像的字符串进行加密.那么我可以以明文形式获取规则的方式配置规则吗?或者我可以解密返回的值吗?这有可能吗,还是我在这里看错了.

I am trying to get the users name, and email, but I can't find a way to configure the "Claim Rule", in a way that I would get a clear text value, instead I get a string that seems to be encrypted. So can I configure the rule in a way that I get it in clear text? Or can I unencrypt the value returned? Is any of this possible or am I looking at the wrong thing here.

谢谢

推荐答案

IIRC,将用户的姓名或电子邮件地址作为声明发布是违反 Windows Live 隐私政策的(与 Gmail 或 Yahoo! 不同).因此,不可能从 Live 获得这些声明(除非您碰巧是 Microsoft).

IIRC, it is against Windows Live privacy policy to release the user's name or email address as claims (unlike Gmail or Yahoo!). As such, it is not possible to get those claims from Live (unless you happen to be Microsoft).

您可以获得的唯一值称为名称标识符.每个 RP 域都是唯一的(即它不是每个 LiveID 的单个值,而是因域而异).这也是有意为之,因此您不能让不同的网站协作来跟踪用户.通常,您会获得名称标识符(称为 PUID),然后将其粘贴在您的数据库中的某个位置,以便您知道您以前见过它.然后用户使用姓名、电子邮件等在您这边注册,您将其与 PUID 相关联.

The only value you can get is called a name identifier. It is unique per RP domain (i.e. it is not a single value per LiveID, but differs by domain). This is also intentional so that you cannot have different websites collaborating to track a user. Typically, you would get the name identifier (called a PUID) and then stick that in your database somewhere so you know that you have seen it before. Then the user registers on your side with name, email, etc. and you correlate that with the PUID.

另一方面,LiveId 还支持 OAuth2,因此您可以从用户那里获取您需要的任何用户个人资料信息(征得他/她的同意).请参阅此处.

On the other hand, LiveId also supports OAuth2, so you can get whatever user profile information you need from the user (with his/her consent). See here.

这篇关于AZURE ACS - Windows Live ID - 如何获取经过身份验证的用户的电子邮件和姓名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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