Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How can I prevent 400 error - "Request Too Long" - when a user is part of many Okta groups?

$
0
0

When a user of my app is included in too many Okta groups, the app (after Okta login) is unusable due to this error:

Bad Request - Request Too LongHTTP Error 400. The size of the request headers is too long.

This error was reported by a user (so important note: it does NOT only occur during debugging). I added myself to every available group just to be able to reproduce the bug. Now that I have done so, the bug is occurring for me. I can see that the cookie is approximately 18.5 KB - big, but not ridiculous.

Changing anything to do with the Okta setup is not an option right now, so I need to find a way to change my app's configuration to avoid this issue.

Note: The app is using IIS Express, Blazor, and .NET Core 3.1.

I have tried every suggestion I have found online, and none of them work:

  1. clear browser cookies and cache
  2. debug in a different browser (its cookies and cache were clear and it had no other windows or tabs open)
  3. add maxAllowedContentLength to applicationhost.config
  4. increase the existing maxAllowedContentLength in web.config
  5. add the following code to startup.cs:
            services.Configure<IISServerOptions>(options =>            {                options.MaxRequestBodySize = int.MaxValue; // or your desired value            });
  1. every combination of suggestions 3, 4, and 5 above
  2. defining httpRuntime within system.web in web.config, including maxUrlLength, maxQueryStringLength, maxRequestLength, and enableVersionHeader='false'
  3. defining maxFieldLength as well as maxAllowedContentLength in applicationhost.config (this wouldn't even run: maxFieldLength was not recognized)

The only suggestion I have seen anywhere that I haven't tried is changing the IIS registry settings, because my team is hoping it doesn't come to that. (The Microsoft documentation itself says this can be extremely dangerous! Surely there's a safer way.) I really want to fix this by configuring the app itself.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>