Skip to content

Bad Request - Request Too Long - IIS Server #344

@kuldeepcis-lab

Description

@kuldeepcis-lab

Describe the issue

I cloned the repository and started working with the BlazorWebappOidc project. I configured the Entra ID settings, such as the client ID and tenant ID, using the details from my Entra ID tenant account. After running the application locally on the Kestrel server with the HTTPS profile, the Blazor application launched successfully. The interface loaded in the browser, and I was able to log in using my Entra ID account. After a successful callback to my Blazor application URL, I was redirected and received the expected details (Such as Username, email address, etc).

However, when I deployed the same application on an IIS server, I encountered an issue. While the Blazor application opened, when I attempted to log in to my Microsoft Entra ID account, I received a Bad Request - Request Too Long (HTTP Error 400. The size of the request headers is too long) error after the callback.

A clear and concise description of what the issue is about.

To Reproduce

Steps to reproduce the behavior:

  1. Go to repository and clone BlazorWebappOidc and Open the application in Visual Studio.
  2. Provide the needed configuration like Tenant ID, Client ID, etc for your Microsoft Azure Entra ID.
  3. Add an IIS Settings to launchsettings.json to run the application on IIS locally then Run
    "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:46294", "sslPort": 44381 } },"profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } }
  4. Click on login and it will redirect you to the authentication flow then provide the Credentials for login (Entra ID Username and password).
  5. After the successful callback you get back to the Blazor Application and then you will see the Error
    Bad Request - Request Too Long (HTTP Error 400. The size of the request headers is too long.)

Expected behavior

After a successful callback to my Blazor application URL, I was redirected and received the expected details (Such as Username, email address, etc).

Screenshots

Screenshot_11

Screenshot_9

Screenshot_10

Additional context

This is so strange to me why I am getting this issue, I have used the same app registration to do the authentication for the Blazor web assembly application (7.0) and it is working on the IIS Server there is no problem, I am getting the expected details from Entra ID.
But in the BlazorWebappOidc this is not working.

Any advice would be appreciated.


Issue Details

Do not edit this section. It is required for issue processing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions