2017-02-16 79 views
0

我想爲我們的一個Web應用程序在辦公室365中包含SSO。 問題是,只要SSO正在工作,我所有的回發都會被忽略。UseOpenIdConnectAuthentication殺死回發

我所做的就是以下, 我安裝的那些包的NuGet - Microsoft.Owin - Microsoft.Owin.Host.SystemWeb - Microsoft.Owin.Security - Microsoft.Owin.Security.Cookies - 微軟.Owin.Security.OpenIdConnect - Owin

我在AAD創建一個應用程序 後來我加入了一些設置,以我的web.config

<add key="ida:PostRedirectUri" value="http://localhost:4439" /> 
 
    <add key="ida:ClientId" value="XXXXXXX" /> 
 
    <add key="ida:AADInstance" value="https://login.microsoftonline.com/" /> 
 
    <add key="ida:Tenant" value="XXXX.onmicrosoft.com" /> 
 
    <add key="ida:PostLogoutRedirectUri" value="http://localhost:4439" />

和我說Startup.vb我有以下內容

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType) 

    app.UseCookieAuthentication(New CookieAuthenticationOptions()) 
    app.UseOpenIdConnectAuthentication(New OpenIdConnectAuthenticationOptions() With { 
     .ClientId = clientId, 
     .Authority = authority 
    }) 
    app.UseStageMarker(PipelineStage.Authenticate) 

的解決方案,並在此之後,SSO工程上的按鈕但是人回發失敗 如果我點擊一個按鈕,頁面只是被重新加載。 IsPostBack參數也是最常見的錯誤。

我發現當我刪除「app.UseOpenIdConnectAuthentication」部分時,回發功能再次起作用,但SSO沒有。 我怎樣才能確保我的回發工作,我也可以使用UseOpenIdConnectAuthentication?

謝謝。

回答

0

我發現這個問題, 在我的web.config我有

<模塊runAllManagedModulesForAllRequests = 「真」> 的System.Web中 拔出鑰匙 「runAllManagedModulesForAllRequests」 解決了這個問題 <模塊>