I've been learning out of the box Owin Identity and I love the ease of use it provides us with user management. Then problem that I have is that it interacts directly with EF (seemingly) via ApplicationDbContext
which I don't want. I would prefer to utilize my 3 tier architecture, IE it interacts with a service layer (BLL) which interacts with EF. I can't find a template, tutorial, or even starting point to maintain all the functionality that is provided and achieve the separation I want.
So is there a way to use a service layer in place of the ApplicationDbContext
in MVC Identity package.
If you want to use existing database/tables, you do not have to use entire ASP.Net Identity. Instead, you can just use Owin Cookie Authentication middleware.
I have working sample code at GitHub. If you want to test it, you just set a break-point at AccountController.cs, and return true.
The followings are two main classes of configure the middleware and sign-in.
Startup.cs
OwinAuthenticationService.cs