I use the following code example to connect the Azure AD login to my application ( https://github.com/AzureADSamples/WebApp-OpenIDConnect-DotNet ).
I find that the code works just fine, but I want to be able to redirect the user to the user login page if the user is not already logged in or their session has expired. However, I am struggling to make this work, and I was wondering if this is really possible?
Is it by design that the user is always redirected to the Microsoft login page for Azure AD, and not to his own page, or is there some kind of setting that I missed?
I added the modified code to FilterConfig.cs to enable the authorization filter attribute:
filters.Add(new AuthorizeAttribute());
I also added the following to web.config , but with no effect:
<authorization> <allow users="?" /> </authorization>
In the Startup.Auth.cs file Startup.Auth.cs I do not see any changes available to app.UseOpenIdConnectAuthentication to allow me to create a common login page, as I can, for example, using cookie-based auth.
source share