Skip to content

Bad Request - Request Too Long - IIS Server #57545

Open
@kuldeepcis-lab

Description

@kuldeepcis-lab

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

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.

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).

Steps To Reproduce

  • Go to repository and clone BlazorWebappOidc and Open the application in Visual Studio.

  • Provide the needed configuration like Tenant ID, Client ID, etc for your Microsoft Azure Entra ID.

  • 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" } } }

  • Click on login and it will redirect you to the authentication flow then provide the Credentials for login (Entra ID Username and password).

  • 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.)

Exceptions (if any)

No response

.NET Version

DOTNET 8

Anything else?

Screenshot_10

cc: @guardrex dotnet/blazor-samples#344

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThis issue tracks updating documentationarea-authIncludes: Authn, Authz, OAuth, OIDC, Bearerarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions