简体   繁体   English

没有外部登录提供程序的 ASP.NET Core MVC 2.2 登录

[英]ASP.NET Core MVC 2.2 login without external login providers

How do you configure asp.net core mvc 2.2 by just using the default local login without external login providers?如何仅使用默认本地登录而不使用外部登录提供程序来配置 asp.net core mvc 2.2?

I can't seem to find a way to remove this:我似乎找不到删除它的方法:

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. 

I only want to use local accounts for now (and maybe later add external providers).我现在只想使用本地帐户(也许以后会添加外部提供程序)。

      services.AddIdentity<ApplicationUser, ApplicationRole>()
        .AddEntityFrameworkStores<ApplicationDbContext>()
        .AddDefaultTokenProviders()
        .AddDefaultUI(UIFramework.Bootstrap4);

This is not configurable.这是不可配置的。 If you look at the implementation of the Login page , you will see that it doesn't use any options, but just renders the messages.如果您查看登录页面的实现,您将看到它不使用任何选项,而只是呈现消息。

Use another service to log in.使用其他服务登录。

is rendered always and总是呈现并且

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.有关设置此 ASP.NET 应用程序以支持通过外部服务登录的详细信息,请参阅本文。

is rendered if there are no external login providers.如果没有外部登录提供程序,则呈现。

There is no way to remove the messages using identity builder or something like that.无法使用身份构建器或类似方法删除消息。 The only way would be to scaffold the Login page (as Kirk Larkin pointed out) and remove the messages from the Login.cshtml file.唯一的办法是脚手架登录页面(如柯克·拉金指出),并从删除的邮件Login.cshtml文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM