title: Redirect user to custom login page when using Azure AD
body: <p>I'm using the following code example to plug in Azure AD login to my application (<a href="https://github.com/AzureADSamples/WebApp-OpenIDConnect-DotNet" rel="nofollow">https://github.com/AzureADSamples/WebApp-OpenIDConnect-DotNet</a>).</p>
  
  <p>I'm finding that the code works just fine however I want to have to ability to redirect a user to a custom login page if the user hasn't logged in yet or their session has expired. I'm struggling however to get this to work and was wondering if this is indeed possible at all?</p>
  
  <p>Is it by design that the user is always redirected to the Microsoft Login page for Azure AD rather than your own custom page or is there a setting I've missed?</p>
  
  <p>I've amended the supplied code in <code>FilterConfig.cs</code> to enable the Authorize filter attribute:</p>
  
  <pre><code>filters.Add(new AuthorizeAttribute());
  </code></pre>
  
  <p>I've also added the following to <code>web.config</code> but to no effect:</p>
  
  <pre><code>&lt;authorization&gt;
  &lt;allow users="?" /&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p>Within the <code>Startup.Auth.cs</code> file I cannot see any changes that are possible to <code>app.UseOpenIdConnectAuthentication</code> to allow me to set up a generic login page as I may possibly do with cookies based auth.</p>