0

Web身份驗證代理可以使用非oAuth身份驗證嗎?Windows 8 Web身份驗證代理無法連接到服務

我創建了一個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的登錄頁面?

回答

0

Web認證代理是爲WinRT應用程序而設計的。

在你的情況下,你有幾個選項。

  1. 使用DotNetOpenAuth直接

  2. 升級到MVC4並使用通過ASP.NET 4.5的另外的包括在默認模板的OAuth的功能提供支持。請參閱Using oAuth Providers with MVC 將它集成到您​​的MVC應用程序中非常簡單。