我有一个 Identity Server 4 实现,我正在将 UI 从 ASP.NET MVC 迁移到一个解耦的 React 应用程序。我遇到的问题是,当 Identity Server 处理错误(例如无效的客户端)时,它会重定向到 /home/error?errorId=<error-id>
我假设使用路径 defined in a constant here .我想自定义此错误路径,使其与我的 React 应用程序中的路由相匹配。知道如何做到这一点吗?我找到的最接近答案的是 here on Github OP 询问是否有计划使这些常量可定制,Brock Allen 回答"is"!那是2016年😁
最佳答案
AddIdentityServer
过载您可以使用它来配置 IdentityServerOptions
被 IdentityServer 使用。这是设置 ErrorUrl
的示例属性(property):
services.AddIdentityServer(options =>
{
options.UserInteraction.ErrorUrl = "/path/to/error";
})
关于c# - 如何覆盖 Identity Server 4 中的默认错误路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58624571/