Using asp net identity with Web API



Using asp net identity with Web API

Using asp net identity with Web API

Text version of the video
http://csharp-video-tutorials.blogspot.com/2016/12/using-aspnet-identity-with-web-api.html

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1

Slides
http://csharp-video-tutorials.blogspot.com/2016/12/using-aspnet-identity-with-web-api_5.html

All ASP .NET Web API Text Articles and Slides
http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-tutorial-for-beginners.html

All ASP .NET Web API Videos
https://www.youtube.com/playlist?list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists

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.
aspnet-EmployeeService-20161122014700.mdf

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.

Comments are closed.