authorization server 用的是 OpenIddict,在完成 authorize 之后 post 客户端应用的 /signin-oidc 时出现 "Correlation failed" 错误,请问如何解决?
/signin-oidc
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware
System.Exception: An error was encountered while handling the remote login.
---> System.Exception: Correlation failed.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
由于没有启用 forwarded headers,AuthenticationMiddleware 误以为当前请求的协议是 http,所以报这个错误,通过环境变量 ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
启用 forwarded headers ,问题就解决了