我正在使用本教程: http: //www.dotnetopenauth.net/developers/help/programmatic-openid-relying-party/
我的 GetResponse() 调用总是返回 null,我还在 web.config 中将 localhost 添加到了我的白名单中。我觉得我做的一切都是正确的,并且无法在线找到解决方案。在调试时我查看 openid 对象。我有 2 个发现服务的计数..
我通过 JS 点击调用下面的方法。
[HttpPost]
public void PingOpenID()
{
var openid = new OpenIdRelyingParty();
IAuthenticationResponse response = openid.GetResponse();
if (response != null)
{
switch (response.Status)
{
case AuthenticationStatus.Authenticated:
FormsAuthentication.RedirectFromLoginPage(
response.ClaimedIdentifier, false);
break;
case AuthenticationStatus.Canceled:
ModelState.AddModelError("loginIdentifier",
"Login was cancelled at the provider");
break;
case AuthenticationStatus.Failed:
ModelState.AddModelError("loginIdentifier",
"Login failed using the provided OpenID identifier");
break;
}
}
}