我一直在使用DotNetOpenAuth工作.首先我们使用5.0.0-alpha1,但我们切换到v4.0.30319,因为我们找不到导致我们问题的原因.
我们在Visual Studio 2013的.NET 4.5.1建立一个C#的Web API项目RC与MVC 5 RC我们已经实施了IAuthorizationServerHost,INonceStore和ICryptoKeyStore.
我们遇到的问题是以下情况:
public class TokensController : Controller
{
private readonly AuthorizationServer authorizationServer = new AuthorizationServer(new MyAuthorizationServer());
/// <summary>
/// This action will handle all token requests.
/// </summary>
/// <returns>The action result that will output the token response.</returns>
[HttpPost]
public ActionResult Index()
{
var outgoingWebResponse = this.authorizationServer.HandleTokenRequest(this.Request);
return outgoingWebResponse.AsActionResult();
}
}
Run Code Online (Sandbox Code Playgroud)
return outgoingWebResponse.AsActionResult();与起源的方法DotNetOpenAuth.Messaging和MessagingUtilities静态类.该DotNetOpenAuth.Core(包含此代码)引用MVC 4.0和HttpResponseMessageActionResult类从继承ActionResult.
这意味着当前版本的DotNetOpenAuth与MVC 5不兼容.编译并尝试运行它只会出现500个错误. …