DotNetOpenAuth对OpenID的声明请求不会返回所有值

时间:2014-07-18 09:13:15

标签: asp.net dotnetopenauth

我想从DotNetOpenAuth OpenID提供商那里获得出生日期。

我现在已经将openID服务器设置为google并执行如下代码:

请求

IAuthenticationRequest authenticationRequest = openid.CreateRequest(Request.Form["openid_identifier"]);

var fields = new ClaimsRequest();
fields.Email = DemandLevel.Require;
fields.FullName = DemandLevel.Require;
fields.BirthDate = DemandLevel.Require;
authenticationRequest.AddExtension(fields);
return authenticationRequest.RedirectingResponse.AsActionResultMvc5();

响应:

switch (response.Status) {
    case AuthenticationStatus.Authenticated:
        Session["FriendlyIdentifier"] = response.FriendlyIdentifierForDisplay;
        FormsAuthentication.SetAuthCookie(response.ClaimedIdentifier, false);
        ClaimsResponse untrustedExtension = response.GetUntrustedExtension<ClaimsResponse>();
        ClaimsRequest claimsRequest = response.GetExtension<ClaimsRequest>();

        if (!string.IsNullOrEmpty(returnUrl)) {
            return Redirect(returnUrl);
        } else {
            return RedirectToAction("Index", "Site");
        }
}

问题是,通过此声明请求,我只获得了电子邮件地址,并且我想要查看所有指定的信息。

是否有可能获得该信息?

0 个答案:

没有答案