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

后端 未结 4 441
眼角桃花
眼角桃花 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:42

    In my case the problem was the order in which I was configuring the application inside Startup.cs.

    Reminder to self - always configure authentication first!

    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
            app.UseCookieAuthentication(new CookieAuthenticationOptions());
            app.UseOpenIdConnectAuthentication(
                new OpenIdConnectAuthenticationOptions
                {
                    ClientId = _clientId,
                    ClientSecret = _clientSecret,
                    Authority = _authority,
                    RedirectUri = _redirectUri
                });
    
            // configure the rest of the application...
        }
    

提交回复
热议问题