title: What exactly is 'UseAuthentication()' for?
body: <p>I have a question regarding authentication in ASP.NET Core 2: what exactly is the call <strong>app.UseAuthentication()</strong> for? </p>
  
  <p>Is it a basic prerequisite so that I can implement my custom authentication logic? I already had a look at the implementation of <a href="https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication/AuthAppBuilderExtensions.cs" rel="noreferrer">UseAuthentication</a> and also of the actual middleware <a href="https://github.com/aspnet/Security/blob/1c30f33c925a97b105b3f9d34497218b0c9342b6/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs" rel="noreferrer">AuthenticationMiddleware</a>, but to be honest, I don't understand what that is actually doing and why it would be necessary. </p>
  
  <p>To put it in another way: </p>
  
  <p>Do I need to call <strong>UseAuthentication()</strong>
  <a href="https://i.stack.imgur.com/MYmlo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MYmlo.png" alt="enter image description here"></a></p>
  
  <p>or is it a nice-to-have and I can do my custom auth anyways?
  <a href="https://i.stack.imgur.com/BhaxK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BhaxK.png" alt="enter image description here"></a></p>
  
  <p>If I was fine without calling <strong>UseAuthentication()</strong> I'd still be interested in what <a href="https://github.com/aspnet/Security/blob/1c30f33c925a97b105b3f9d34497218b0c9342b6/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs" rel="noreferrer">AuthenticationMiddleware</a> is actually doing. So if you knew that I'd be very grateful if you could explain it for me as well. </p>