首页 新闻 赞助 找找看

ASP.NET Core OpenID Connect 遇到 "Correlation failed" 问题

0
悬赏园豆:30 [已解决问题] 解决于 2022-08-29 11:13

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)
dudu的主页 dudu | 高人七级 | 园豆:31326
提问于:2022-08-29 10:02
< >
分享
最佳答案
0

由于没有启用 forwarded headers,AuthenticationMiddleware 误以为当前请求的协议是 http,所以报这个错误,通过环境变量 ASPNETCORE_FORWARDEDHEADERS_ENABLED=true 启用 forwarded headers ,问题就解决了

dudu | 高人七级 |园豆:31326 | 2022-08-29 11:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册