Windows 8 Web身份验证代理无法连接到该服务

时间:2013-04-25 09:39:05

标签: c# windows-8 windows-runtime single-sign-on windows-store-apps

Web身份验证代理是否可以与非oAuth身份验证一起使用?

我创建了一个Asp.Net MVC2网站,其中包含一个登录页面,我想通过Web身份验证代理来检索并保留身份验证cookie。

以下是代码:

WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
WebAuthenticationOptions.None,
new Uri("https://localhost:44301/Account/LogOn"),
new Uri("https://localhost:44301/"));

加载时,WAB返回以下消息“无法连接到服务”,当查看事件查看器时,会出现导航错误事件。

我的代码有问题,或者无法连接到基于cookie的登录页面?

1 个答案:

答案 0 :(得分:0)

Web身份验证代理适用于WinRT应用程序。

在您的情况下,您有几种选择。

  1. 直接使用DotNetOpenAuth

  2. 升级到MVC4并使用ASP.NET 4.5提供的支持添加默认模板中包含的oAuth功能。见Using oAuth Providers with MVC 它非常容易集成到您的MVC应用程序中。

相关问题