小编jen*_*ens的帖子

DotNetOpenAuth不使用MVC 5 RC

我一直在使用DotNetOpenAuth工作.首先我们使用5.0.0-alpha1,但我们切换到v4.0.30319,因为我们找不到导致我们问题的原因.

我们在Visual Studio 2013的.NET 4.5.1建立一个C#的Web API项目RC与MVC 5 RC我们已经实施了IAuthorizationServerHost,INonceStoreICryptoKeyStore.

我们遇到的问题是以下情况:

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.MessagingMessagingUtilities静态类.该DotNetOpenAuth.Core(包含此代码)引用MVC 4.0和HttpResponseMessageActionResult类从继承ActionResult.

这意味着当前版本的DotNetOpenAuth与MVC 5不兼容.编译并尝试运行它只会出现500个错误. …

c# asp.net asp.net-mvc dotnetopenauth oauth-2.0

37
推荐指数
2
解决办法
6492
查看次数

标签 统计

asp.net ×1

asp.net-mvc ×1

c# ×1

dotnetopenauth ×1

oauth-2.0 ×1