Too many cookies OpenIdConnect.nonce cause error page “Bad Request - Request Too Long”

后端 未结 4 442
眼角桃花
眼角桃花 2020-12-02 19:15

I\'m using OWIN / OAuth with OpenId Connect authentication (Microsoft.Owin.Security.OpenIdConnect) in a C# ASP MVC web app. The SSO login with Microsoft account

4条回答
  •  失恋的感觉
    2020-12-02 19:38

    For me the solution was to enforce the creation of an ASP.NET session.

    Steps to reproduce:

    • Delete ASP.NET_SessionId cookie and idsrv cookie on a protected page of your webapp
    • Reload page
    • Redirect to OIDC authentication store and authenticate
    • Redirect back to webapp => validation of the authentication fails, because no asp.net session is available
    • Endless redirects until 'Request too long...' error happens

    Solution: Enforce session creation by adding

    protected void Session_Start(object sender, EventArgs e)
    {
    }
    

    to global.asax.cs.

提交回复
热议问题