title: Map asp.net core 2.0 Identity to existing DB schema
body: <p>I have built a small web application with asp.net core 2.0 MVC. In this web application, I did <strong>not</strong> implement any authentication methods so far.</p>
  
  <p>Right now I have an MSSQL database running in the background and I can add/view/edit/delete users from the database. 
  I adapted <a href="https://www.c-sharpcorner.com/article/crud-operation-with-asp-net-core-mvc-web-app-using-ado-net/" rel="nofollow noreferrer">this tutorial</a> and followed it pretty closely. However I also added some functionality like localization and stuff, and everything is running pretty smoothly.</p>
  
  <p>My next goal is to enable authentication and authorization. The authentication part shall be straightforward. The goal is that the application will be running as an intranet solution. This means the authentication method just shall check if the Windows User is existing in the previously mentioned database. I don't want to create a separate login. However, it might be that there is a Windows user in the active directory, which is not part of the database. This User should just be able to see a default error page.</p>
  
  <p>I made quite a huge research and I also tried a lot of different stuff, however, I do absolutely not find any "database first" tutorial for this part or any other documentation which explains what to do.</p>
  
  <p>I actually "just" want to teach the asp.net core 2.0 identity framework that it shall look into my user-table and check if the current windows user is existent and if not to forward him to the error page.
  A second step would be to load all the roles which this user is assigned to from the mapping table.</p>
  
  <p>Any kind of help would be highly appreciated.</p>