title: Redirect to login when unauthorized in ASP.NET Core
body: <p>In the previous ASP.NET MVC, there was an option to redirect to the login action, if the user was not authenticated.</p>
  
  <p>I need the same thing with ASP.NET Core, so I:</p>
  
  <ol>
  <li>created a ASP.NET Core project from the Visual Studio template</li>
  <li>added <code>[Authorize]</code> to some arbitrary action</li>
  <li>opened the corresponding view in my browser</li>
  </ol>
  
  <p>I don't expect a redirect because I haven't configured it. BUT, it automatically redirects to the login action!</p>
  
  <p>Where/how is this option set?</p>