【问题标题】:UseOpenIdConnectAuthentication kills postbackUseOpenIdConnectAuthentication 杀死回发
【发布时间】:2017-02-16 15:44:16
【问题描述】:

我正在尝试为我们的一个 Web 应用程序在 Office 365 中包含 SSO。 问题是,只要 SSO 工作,我的所有回发都会被忽略。

我所做的是以下, 我安装了那些 Nuget 包 - 微软.Owin - Microsoft.Owin.Host.SystemWeb - Microsoft.Owin.Security - Microsoft.Owin.Security.Cookies - Microsoft.Owin.Security.OpenIdConnect - 欧文

我在我的 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 参数也始终为 false。

我发现,当我删除“app.UseOpenIdConnectAuthentication”部分时,回发又可以工作了,但 SSO 没有。 如何确保我的回发正常工作并且我也可以使用 UseOpenIdConnectAuthentication ?

谢谢。

【问题讨论】:

    标签: single-sign-on postback


    【解决方案1】:

    我发现了问题, 在我的 web.config 我有

    在 system.web 删除密钥“runAllManagedModulesForAllRequests”解决了问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-23
      • 2011-11-03
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多