要摆脱ASP.NET Core应用程序登录页面上的“使用其他服务登录”消息,可以使用以下代码示例:
在Startup.cs文件的ConfigureServices方法中添加以下代码:
// Removes the other services link from the login page
services.Configure
此代码将从登录页面中删除其他服务链接。 如果您有自己的身份验证服务,则可以使用此代码在登录期间调用该服务。
注意:上面的代码示例需要使用Microsoft.AspNetCore.Authentication.IdentityServer和Microsoft.AspNetCore.Authentication.OpenIdConnect命名空间,需要将它们添加到项目中。