我有一个项目,我们正在使用程序包Microsoft.AspNetCore.Authentication.AzureADB2C.UI向Azure AD B2C进行身份验证。有时,如果会话过期或用户尝试直接从Azure AD B2C登录页面登录,则将显示以下错误页面[错误页面](https://github.com/dotnet/aspnetcore/blob/master/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/Areas/AzureADB2C/Pages/Account/Error.cshtml):
但是,我想自定义此页面,但是我不知道该怎么做。
我已经通过替换Sign Out方法来定制AzureADB2C Controller以使用自定义的注销页面。但是,此控制器中没有“错误”方法。
有人可以告诉我要去的方向吗?
谢谢
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Account/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
//Put this method:
app.UseRewriter(new RewriteOptions().Add(context =>
{
if (context.HttpContext.Request.Path == "/AzureADB2C/Account/SignedOut")
{
context.HttpContext.Response.Redirect("/Home/SignedOut");
}
}));
app.UseHsts();
}