title: Token Based Authentication in ASP.NET Core
body: <p>I'm working with ASP.NET Core application. I'm trying to implement Token Based Authentication but can not figure out how to use new <a href="https://github.com/aspnet/Security" rel="noreferrer">Security System</a> for my case.
  I went through <a href="https://github.com/aspnet/Security/tree/dev/samples" rel="noreferrer">examples</a> but they didn't help me much, they are using either cookie authentication or external authentication (GitHub, Microsoft, Twitter). </p>
  
  <p>What my scenario is: angularjs application should request <code>/token</code> url passing username and password. WebApi should authorize user and return <code>access_token</code> which will be used by angularjs app in following requests.</p>
  
  <p>I've found great article about implementing exactly what I need in current version of ASP.NET - <a href="http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/" rel="noreferrer">Token Based Authentication using ASP.NET Web API 2, Owin, and Identity</a>. But it is not obvious for me how to do the same thing in ASP.NET Core.</p>
  
  <p>My question is: how to configure ASP.NET Core WebApi application to work with token based authentication?</p>