-
Notifications
You must be signed in to change notification settings - Fork 600
Unhandled remote failure #1069
Comments
Moreover, sometimes I get also this (message.State is null or empty):
|
The 'Correlation failed.' is from a missing cookie. This usually means that the login process took too long (more than 15min), or that the client's cookie store was too full and one got discarded. The missing State is a little stranger. That implies the IDP (IdentityServer4) didn't return that parameter to you. There's also a remote possibility the parameter failed to decrypt for some reason. |
We are always returning state correctly. Maybe a URL length issue? hm - it seems to post. So that's probably not the problem. |
@leastprivilege I don't think it is related to the url length. When it happens I get a specific error into the log, in this case I've just this message. I've added also the dataprotection to use a shared key for decryption but nothing changes. |
It will be hard to tell without some fiddler traces and logs. |
I know. |
How about in the MessageReceived event? That's just before the state exception. |
ok, what exactly should I check into the Thanks |
Request.Form |
ok, cool. OnMessageReceived = ctx =>
{
if (string.IsNullOrEmpty(ctx.ProtocolMessage.State))
{
StringBuilder sbForm = new StringBuilder();
sbForm.Append("Form:");
sbForm.AppendLine();
sbForm.AppendLine();
foreach (KeyValuePair<string, StringValues> formKey in ctx.Request.Form)
{
sbForm.AppendFormat("{0}: {1}", formKey.Key, formKey.Value);
}
StringBuilder sbProtocol = new StringBuilder();
sbProtocol.Append("Protocol:");
sbProtocol.AppendLine();
sbProtocol.AppendLine();
sbProtocol.AppendFormat("AccessToken: {0}", ctx.ProtocolMessage.AccessToken);
sbProtocol.AppendFormat("Code: {0}", ctx.ProtocolMessage.Code);
sbProtocol.AppendFormat("Display: {0}", ctx.ProtocolMessage.Display);
sbProtocol.AppendFormat("AuthorizationEndpoint: {0}", ctx.ProtocolMessage.AuthorizationEndpoint);
sbProtocol.AppendFormat("Error: {0}", ctx.ProtocolMessage.Error);
sbProtocol.AppendFormat("ErrorDescription: {0}", ctx.ProtocolMessage.ErrorDescription);
sbProtocol.AppendFormat("ErrorUri: {0}", ctx.ProtocolMessage.ErrorUri);
logger.LogError("Message Received = {0}", sbForm.ToString());
logger.LogError("Protocol Message = {0}", sbProtocol.ToString());
}
return Task.CompletedTask;
} News when it happens again. |
Ok, it seems is not possible to read the here the complete stack
Any idea? |
Moreover, few milliseconds before, I got "System.Exception: Correlation failed." |
That's interesting, you're getting a non-Form-Post request to your OIDC endpoint. How about logging all the request headers, path, and query. |
Back! |
Here we go. RequestPath:
Query:
Headers:
##ProtocolMessage
Useful? |
Yeah, that's not a login request. Some user is ending up at /signin-oidc without a body, content type, cookies, etc.. not much you can do about it but find them and ask why/how. |
Yeah this looks like it's just some random client making a call to your site, so it might just be an innocuous error. You might want to look at the calling IP address to see what/who it is. |
Really I found a way to replicate it.
Is it normal? Thanks |
Hi @Eilon |
@Tratcher can you review the trace and see what's going on here? |
These are two different issues. The one in your original post was a GET request to /signin-oidc, which there's still no explanation for why the client sent. The one from your manual repro is a POST to /signin-oidc which is intentionally missing cookies. This does not explain the first issue, but we can show you ways to mitigate it. If you hook into the OnRemoteFailure event you can override the default 500 response with your own response or redirect. |
We are not able to find any issues in the middleware, so we are closing this issue. |
We had this same exception and found out that it can be caused when a user presses the back button in FF. Chrome seems to work ok. |
Hi,
I've an application that is using
UseOpenIdConnectAuthentication
with IdentityServer 4 and sometimes I get this weird error:Unfortunately I didn't find a way to replicated the problem, it just comes up into the log randomly.
Here my configuration
I'm running the app on Azure AppService with fw46.
Do you have any hint on how to fix/understand the problem?
The text was updated successfully, but these errors were encountered: