我使用的是Window Azure平臺爲我的應用程序,我試着從他們在谷歌/雅虎帳戶提取用戶的信息..如何添加自定義聲明到ACS服務標識
但信息米通過Azure的輸入/輸出索賠獲取只是他們的名字,電子郵件地址和身份提供者...有人可以幫助我獲取他們的國家或他們的移動號碼,當他們已經在谷歌/雅虎註冊
這是我的示例代碼獲取聲稱:
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);
當m編輯我的規則時,ClaimsPrincipal不會將country/mobilenumber的值計入其帳戶中.... PLZ HELP !!!!!