Text version of the video
All ASP .NET Web API Text Articles and Slides
All ASP .NET Web API Videos
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic
In this video we will discuss customizing and using asp.net identity server with Web API.
In our previous video we have seen that the database that the identity system creates has a strange name.
Identity database tables and their purpose
__MigrationHistory – This table tells us that it is using entity framework
AspNetRoles – Stores roles information. We do not have any roles yet so this table is empty
AspNetUserClaims – We do not have claims either so this table will also be empty
AspNetUserLogins – This table is for third party authentication providers like Twitter, Facebook. Microsoft etc. Information about those logins will be stored in this table
AspNetUserRoles – This is a mapping table which tells us which users are in which roles
AspNetUsers – This table stores the registered users of our application
At this point the obviuos question that comes to our mind is, is it possible to change the database name. If so, how can we do it?
The DefaultConnection string in web.config controls the name of the generated database. To change the name of the generated database change the DefaultConnection string in web.config.
Can we create asp.net identity database in SQL Server
Yes we can. To create the database in SQL Server, change the DefaultConnection string in web.config to point to your SQL Server.
Is it mandatory for the Identity tables to be in a separate database. Can’t we have them created in an exisiting database.
No it is not mandatory for the Identity tables to be in a separate database. You can have them created by Identity framework in an existing database by just making your connection string point to your existing database instead of a separate database.
ASP.NET Identity system can be used with all of the ASP.NET frameworks, such as ASP.NET MVC, Web Forms, Web API, and SignalR. It can be used when you are building web, phone, store, or hybrid applications.
In our next video we will discuss implementing the Login page.