'IPrincipal' is this . Net framework interface :
public interface IPrincipal {
This interface defines the basic functionality of a registered user. The object that implements this interface is the security context under which your code works. You can get different flavors of IPrincipal in .Net: ClaimsPrincipal , WindowsPrincipal and others - it all depends on the structure used. If you work with an Asp.Net Identity database, you will be dealing with ClaimsPrincipal . Usually you do not need to implement this interface.
IIdentity represents user permissions. For the Asp.Net Identity framework, you will be dealing with ClaimsIdentity . Again, this is something you do not need to implement.
The following is the documentation for IPrincipal and IIdentity .
IUser is part of the Identity Asp.Net framework. If you use the Entity Framework part of Identity, you will be provided with an IdentityUser class that you can inherit and extend. This is the model for you.
Basically, IdentityUser is a POCO that is stored in a database. And when the user logs in, the information from IdentityUser will be converted to ClaimsPrincipal and ClaimsIdentity using the framework. And when you get access to HttpContext.Current.User , you will be provided with ClaimsPrincipal .
Hope this clears you up.
trailmax
source share