title: How to authenticate a user in a .NET Core MVC frontend, with a .net core identity framework
body: <p>I have an ASP.NET CORE MVC WebApp with Identity framework. Now that we are also planning to extend our product such that we can provide mobile apps with xamerin, I decided to make an API so that we don't have to code the backend twice. We currently host our App in the Azure Cloud.</p>
  
  <p>For the backend: I would like to use ASP.NET CORE WebApi but I figured that there is no such Identity template nor a native Azure Web API integration. So would it be better to use ASP.NET instead? I already created a basic login AccountController for .net core API.</p>
  
  <p>Since I authenticated the ASP.NET Core MVC Web App via identity framework, I would like to also use that in the backend. So that you log in on the backend and receive a token, once you logged in successfully. I have to code to login the user at the backend and return a token. </p>
  
  <p>How exactly can I authenticate the .NET ASP CORE Frontend? The user will query the login page -> AuthConntroller.Login-> Login method starts a call to Login Backend API -> Backend API queries backend-database -> if successful return true-> backend generates a token->sends it back to frontend-> frontend uses Owin so that I can use the [Authorize] Attribute in the controller classes so that I can authenticate the user?</p>
  
  <p>Anything else that I have to consider when I'm using such an API design?</p>
  
  <p>Thank you so much for any hints/tricks/links/recommendations on my dilemma.</p>
  
  <p>Sincerely, Paul</p>