juF*_*uFo 7 c# asp.net-core-mvc asp.net-core-identity
如何仅使用默认本地登录而不使用外部登录提供程序来配置 asp.net core mvc 2.2?
我似乎找不到删除它的方法:
Use another service to log in.
There are no external authentication services configured. See this article for details on setting up this ASP.NET application to support logging in via external services.
Run Code Online (Sandbox Code Playgroud)
我现在只想使用本地帐户(也许稍后会添加外部提供商)。
services.AddIdentity<ApplicationUser, ApplicationRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders()
.AddDefaultUI(UIFramework.Bootstrap4);
Run Code Online (Sandbox Code Playgroud)
这是不可配置的。如果您查看登录页面的实现,您会发现它没有使用任何选项,而只是呈现消息。
使用其他服务登录。
总是被渲染并且
没有配置外部身份验证服务。有关设置此 ASP.NET 应用程序以支持通过外部服务登录的详细信息,请参阅本文。
如果没有外部登录提供程序,则会呈现。
无法使用身份生成器或类似的东西删除消息。唯一的方法是构建登录页面(正如Kirk Larkin指出的那样)并从文件中删除消息Login.cshtml。