title: AllowAnonymous Attribute not working MVC 5
body: <p>Inside the Azure Portal I set App Service Authentication "On" For my Web App and I use AAD as Authentication Provider. </p>
  
  <p>This has worked great up until now, I need an endpoint that will allow anonymous users, however the attribute <code>[AllowAnonymous]</code> does not work, I am still required to sign in. </p>
  
  <p>Code:</p>
  
  <pre><code>[Authorize]
  [RoutePrefix("users")]
  public class UsersController : Controller
  {
      [Route("register/{skypeid}")]
      public ActionResult Register(string skypeid)
      {
              ///stuff...            
          }
          catch (Exception ex)
          {
              return Content(ex + "");
          }
  
          ViewBag.Name = name;
          return View();
  
      }
  
      [AllowAnonymous]
      [Route("exists/{skypeid}")]
      public ActionResult Exists(string skypeid)
      {
          return Content("Hello " + skypeid);
      }
  </code></pre>
  
  <p>I think the code is right, so does it have something to do with the fact that I use App Service Authentication for my Web App?</p>
  
  <p>EDIT:
  So, I found the source of the problem, In Azure if you set "Action to take when not Authenticated" to "Sign in with Azure Active Directory", it does never allow anonymous.</p>
  
  <p>However, If I change it to allow anonymous then users are not prompted to sign in when trying to access a control with the [Authorize]-Attribute, it just tells me "You do not have permission to view this directory or page." 
  Is this intended? It seems really weird. I want users to be redirected to Login if there is an [Authorize]-Attribute.</p>
  
  <p>Screenshots for clarity:</p>
  
  <p><a href="https://i.stack.imgur.com/AvYNS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AvYNS.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/B2qz6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B2qz6.png" alt="enter image description here"></a></p>