I use a lot of claims and store them in token. I encountered this error before only in swagger, and clearing cache always worked for me. However, now I see this error in production environment. Current "Authorization" header that is giving this error is ~16kb. I tried to increase "Authorization" header size in IIS, added these to web.config
<system.web>
<httpRuntime maxRequestLength="500000000" executionTimeout="120" />
</system.web>
<location path="." inheritInChildApplications="false">
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="500000000" />
</requestFiltering>
</security>
and added tried increasing limit in Kestrel:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureKestrel((context, options) =>
{
options.Limits.MaxRequestHeadersTotalSize = 1048576;
});
}
None of the above helped. I didn't find other solutions, what else can be done here?