asp.net - .NET Core 2.2 无法访问控制器但脚手架登录工作
问题描述
我目前无法联系到我的账户管理员。由于某些原因,我正在更换脚手架身份登录。
我的 AccountController 的当前路径是 Areas > Identity > Pages > Account > AccountController
以前是区域 > 身份 > 页面 > 帐户 > 登录
这是我的 AccountController 的顶部
[Area("Identity")]
[AllowAnonymous]
[TypeFilter(typeof(ValidateApplicationStatusFilter), Arguments = new object[] { ApplicationGlobals.DocumentStudio })]
public class AccountController : Controller
在我的 Startup.cs 中,我将登录路径设置为:
options.LoginPath = "/Identity/Account/Login";
我试图在 AccountController 中的 Login 函数上放置一个调试器,但它从未成功。当我现在登录时,它会显示一个不同的登录表单,这似乎是 .net 创建的默认表单?
解决方案
我发现了问题所在。
在 Startup.cs 中,我正在使用
services.AddDefaultIdentity
这以某种方式迫使它使用默认登录页面。当我将其更改为
services.AddIdentity
有效。
推荐阅读
- javascript - 忽略大小写sql查询
- azure-active-directory - .NET Core 3.1 到 .NET 5 的迁移 - Microsoft Identity Web Platform 停止工作
- java - ObjectMapper 类构造
- r - R:比较列表中的每个值是其他值
- python-3.x - PIL:TIFF 文件中的“I”带代表什么
- google-cloud-platform - 带有 python flex 模板的数据流 - 启动器超时
- i2c - ESP32 i2c GY-906 0xFF 1037.55 响应,温度传感器
- html - Angular 10中的复选框选中状态
- php - GitLab API `400 Bad Request` 响应:错误请求
- java - 使用 Spring Boot Security 将 JSESSIONID cookie 名称更改为其他名称