After the completion of about 40-45 APIs, the size of the authorization token is around 40 kb. And now after login whenever any request is being sent to the server it gives an error of "Bad Request, Header too long.
For Kestrel Server the blow code has been solved the error -
webBuilder.ConfigureKestrel(options =>
{
options.Limits.MaxRequestHeadersTotalSize = 1048576;
})
But for IIS Server I haven't got any kind of solution The solution I have tried is
Increased the RequestLimit from web.config file.
Add the MaxFieldLength and MaxRequestBytes in
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/HTTP/Parameters
Add the below code in ConfigureServices method
services.Configure(options => { options.AutomaticAuthentication = true; options.ForwardWindowsAuthentication = true; });
and many more tries but not got the final solution. Please help if anyone can...