Search code examples
c#asp.net-coreauthenticationazure-active-directoryidentityserver4

ASP .NET Core identity server default login page as Microsoft


I have integrated the identity server together with Azure AD login for the current web app. May i know how do i immediately redirect user to Azure AD Microsoft login page when they are not authenticated, instead of showing the identity server login page?


Solution

  • Thank you leastprivilege & AndrewSilver Posting your suggestion as an answer to help other community members .

    " 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 "

    For example :

    if you have named Azure AD as identity source provider – aad then you just need to pass this type of values as acr_values

    idp: aad

    For more information please refer this Blog : Skip Identity server login page for Azure AD in identity server 4