question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Always get Bad Request - Request Too Long

See original GitHub issue

I hosted the all applications(Dev branch) in server, where Identity server is working as expected but when IS4 admin makes the request for authentication it is authenticated and after “Consent” step the error comes as “Bad Request - Request Too Long”. HTTP Error 400. The size of the request headers is too long. . FYI I could see in browser status bar that requests are circular for admin app and server. Its showing “waiting for [server1 IDS4]…” and then “waiting for [server2 admin]…” and keep showing back and forth. Then error comes as Bad Request - Request Too Long. Any help please… https://test.com/ " Credentials are same as documentation, but try it with email" The applications work well in my local dev machine.

For the ssl configuration, I am using free cloudflare ssl for is4server: Used these settings as it is below:

“CertificateConfiguration”: {

"UseTemporarySigningKeyForDevelopment": true,

"CertificateStoreLocation": "LocalMachine",
"CertificateValidOnly": true,
 .......

} Should I change it to something else? Might be causing this issue.

Here is the log created in is4.admin:

2019-11-21 07:13:10.459 +01:00 [ERR] Message contains error: ‘invalid_request’, error_description: ‘error_description is null’, error_uri: ‘error_uri is null’, status code ‘400’. 2019-11-21 07:13:10.459 +01:00 [ERR] Exception occurred while processing message. Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException: Message contains error: ‘invalid_request’, error_description: ‘error_description is null’, error_uri: ‘error_uri is null’. at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleRemoteAuthenticateAsync() 2019-11-21 07:13:10.461 +01:00 [ERR] An unhandled exception has occurred while executing the request. System.Exception: An error was encountered while handling the remote login. —> Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolException: Message contains error: ‘invalid_request’, error_description: ‘error_description is null’, error_uri: ‘error_uri is null’. at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.RedeemAuthorizationCodeAsync(OpenIdConnectMessage tokenEndpointRequest) at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.HandleRemoteAuthenticateAsync() — End of inner exception stack trace — at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.CspMiddleware.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
skorubacommented, Nov 21, 2019

You can verify this issue on test environment with this code snippet - try it in Startup.cs in section - Configure:

app.Use(async (context, next) =>
            {
#if RELEASE
                context.Request.Scheme = "https";
#endif
                await next.Invoke();
            });
0reactions
skorubacommented, Nov 26, 2019

Deleted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Edge - Bad Request - Headers Too Long issue
This usually means that you have one or more cookies that have grown too big. Visit https://support.microsoft.com and - assuming the site opens ......
Read more >
Bad Request - Header Field Too Long Error
The “Bad Request – Request Too Long” error is exclusive to browsers. The typical solution is to clear the cache and cookies in...
Read more >
How to Fix a 400 Bad Request Error: 8 Easy Methods
The HTTP status 400 – bad request indicates that the request sent to the server is invalid or corrupted. Just like other 4xx...
Read more >
Bad Request: Header Field Too Long [Error Fix]
To fix Bad request header field too long error, all that you have to do is to check your cache, and this guide...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes)
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found