title: Unable to change "access denied path" when using Azure AD authentication without Identity
body: <p>I'm unable to change the default "access denied" path of <code>Account/AccessDenied</code> when using Azure AD authentication. What settings do I need to configure to override this? 
  I've looked at several articles including <a href="https://stackoverflow.com/questions/51833380/changing-default-access-denied-path-when-integrating-azure-ad-into-an-asp-net-co">this</a> but no success yet.</p>
  
  <p>My current <code>startup.cs</code> code looks like this -</p>
  
  <pre><code>services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
                  .AddAzureAD(options =&gt; Configuration.Bind("AzureAd", options))
                  .AddCookie(options =&gt;
                  {
                      options.AccessDeniedPath = "/Error/AccessDenied";
                      options.Events = new CookieAuthenticationEvents
                      {
                          OnRedirectToAccessDenied = ctx =&gt;
                            {
                                var requestPath = ctx.Request.Path;
                                if (requestPath.StartsWithSegments("/Account"))
                                {
                                    ctx.Response.Redirect("/Error/AccessDenied?ReturnUrl=" + requestPath + ctx.Request.QueryString);
                                }
                                else
                                {
                                    ctx.Response.Redirect("/Login?ReturnUrl=" + requestPath + ctx.Request.QueryString);
                                }
                                return Task.CompletedTask;
                            }
                      };
                  });
  </code></pre>
  
  <p>This redirect doesn't work and the event is not fired either. I've tried setting cookie options using <code>services.ConfigureApplicationCookie</code> but that doesn't work either (documentation says it's for identity module anyways).</p>
  
  <p>What am I missing?
  My asp.net project is using .net core 2.2 and it's template was generated from the Visual Studio template.</p>