我正在为我的应用程序使用 Window Azure 平台,我试图从他们在 google/yahoo 中的帐户中获取用户的信息。
但是我通过 Azure 的输入/输出声明获得的信息只是他们的姓名、电子邮件地址和身份提供者......当他们在 google/yahoo 中注册时,有人可以帮我获取他们的国家或手机号码吗
这是我获取声明的示例代码:
protected void Page_Load(object sender, EventArgs e)
{
{
ClaimsPrincipal icp = Thread.CurrentPrincipal as ClaimsPrincipal;
ClaimsIdentity claimsidentity = icp.Identity as ClaimsIdentity;
string email = "", name = "", idprovider = "" ;
foreach (Claim c in claimsidentity.Claims)
{
if (c.ClaimType == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress")
{
email = c.Value;
}
if (c.ClaimType == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name")
{
name = c.Value;
}
if (c.ClaimType == "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider")
{
idprovider = c.Value;
}
}
Label1.Text = (name + email + idprovider);
当我编辑我的规则时,ClaimsPrincipal 没有将国家/移动号码值计入其帐户....PLZ HELP !!!!!