title: .AspNetCore.Correlation. state property not found. Unknown Location
body: <p>I am using hybrid authentication flow with OIDC.</p>
  
  <pre><code>options.Events.OnRedirectToIdentityProvider = redirectContext =&gt;
                        {
                            if (redirectContext.Request.Path.StartsWithSegments("/api"))
                            {
                                if (redirectContext.Response.StatusCode == (int)HttpStatusCode.OK)
                                {
                                    AuthenticationProperties  properties = new AuthenticationProperties();
                                    properties.RedirectUri = redirectContext.ProtocolMessage.RedirectUri;
                                    redirectContext.ProtocolMessage.State = options.StateDataFormat.Protect(properties);
                                    redirectContext.Response.StatusCode =   (int)HttpStatusCode.Unauthorized;
                                    redirectContext.Response.Headers["Location"] = redirectContext.ProtocolMessage.CreateAuthenticationRequestUrl();
                                }
                                redirectContext.HandleResponse();
                            }
                            return Task.CompletedTask;
                        };
  </code></pre>
  
  <p>As in above code I have manually set "state" property (which was suggested by ASP.Net core team, not in exact same way. refer below github issue link), but it is not working. </p>
  
  <p>On callback, it gives warning as <strong>".AspNetCore.Correlation. state property not found"</strong> and then it fails (as per below github bug) as "<strong>Error from RemoteAuthentication: Correlation failed..</strong>"</p>
  
  <p><a href="https://github.com/aspnet/AspNetCore/issues/7501" rel="nofollow noreferrer">https://github.com/aspnet/AspNetCore/issues/7501</a></p>
  
  <p>So what am I doing wrong. Because suggestion given in above bug is not possible, because it has some values which I don't have in this event. </p>
  
  <p>what am I missing (or must do to complete this flow)?</p>