DotNetOpenAuth检测谷歌等获取请求

时间:2011-08-18 17:15:26

标签: asp.net-mvc asp.net-mvc-3 dotnetopenauth

使用Google,您可以像这样获取用户的电子邮件:

var fetch = new FetchRequest();
fetch.Attributes.AddRequired(WellKnownAttributes.Contact.Email);
request.AddExtension(fetch);

然后像这样回复:

var fetch = response.GetExtension<FetchResponse>();
string email = "";
if (fetch != null)
{
    email = fetch.GetAttributeValue(WellKnownAttributes.Contact.Email);
}

撰写提供者时,如何返回要求的值?

1 个答案:

答案 0 :(得分:0)

DotNetOpenAuth附带的OpenIdProviderWebForms示例包括返回用户属性。你看过了吗?