ASP .NET Core 身份服务器默认登录页面为 Microsoft

ASP .NET Core identity server default login page as Microsoft

我已经将身份服务器与当前 Web 应用程序的 Azure AD 登录集成在一起。我可以知道如何在用户未通过身份验证时立即将用户重定向到 Azure AD Microsoft 登录页面,而不是显示身份服务器登录页面吗?

谢谢 leastprivilege & AndrewSilver 将您的建议作为答案发布以帮助其他社区成员。

" There are a couple of ways to influence the login workflow.

The client application can include a hint to identityserver which external provider to use - this is done via the acr_values parameter (idp:name_of_ext_idp).

You can also statically configure the ext provider per client (set EnableLocalLogin to false, and IdentityProviderRestrictions to the name of the ext. provider).

Furthermore you can also handle the PreAuthenticateAsync method on the user service and dynamically set the Idp property on the SignInMessage "

例如:

如果您已将 Azure AD 命名为身份源提供者 – aad 那么您只需将此类值作为 acr_values[=22 传递=]

idp: aad

有关更多信息,请参阅此博客:Skip Identity server login page for Azure AD in identity server 4