How do you create a custom ASP.NET MVC 5 Auth without using the UserStore of Microsoft.AspNet.Identity.EntityFramework??
ASP.NET Core Identity: Is an API that supports user interface (UI) login functionality. Manages users, passwords, profile data, roles, claims, tokens, email confirmation, and more.
Select File >> New >> select ASP.NET Core Web Application, and change the authentication to Windows Authentication. We can also configure the existing application for Windows Authentication by selecting the option of WA. To configure the authentication manually, open Visual Studio project properties >> go to Debug tab.
All you have to do is implement the same interfaces that the Userstore for Identity.Entityframework
uses.
User
will be your user class
public class MyUserStore<TUser> :
IUserLoginStore<TUser, int>,
IUserClaimStore<TUser, int>,
IUserRoleStore<TUser, int>,
IUserPasswordStore<TUser, int>,
IUserSecurityStampStore<TUser, int>,
IUserStore<TUser, int>,
IDisposable where TUser : User
{
//Implement the interfaces you need
}
Then pass your MyUserStore
into the UserManager
each request
new UserManager<User, int>(new MyUserStore<User>(new MyContext()))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With