3 levels with Identity and EF

I am developing a three-level project with authentication from scratch. I use the following as a guide for implementing identity authentication: http://bitoftech.net/2015/01/21/asp-net-identity-2-with-asp-net-web-api-2-accounts-management/

The problem is that I need to install the following NuGet packages:

Install-Package Microsoft.AspNet.Identity.Owin -Version 2.1.0 Install-Package Microsoft.AspNet.Identity.EntityFramework -Version 2.1.0 Install-Package Microsoft.Owin.Host.SystemWeb -Version 3.0.0 Install-Package Microsoft.AspNet.WebApi.Owin -Version 5.2.2 Install-Package Microsoft.Owin.Security.OAuth -Version 3.0.0 Install-Package Microsoft.Owin.Cors -Version 3.0.0 

I intuitively installed Microsoft.AspNet.Identity.Owin into my presentation level and now the dilemma is Microsoft.AspNet.Identity.EntityFramework , where does it go? I already installed EF6 in the data access layer, is there a way to provide this dependency to Microsoft.AspNet.Identity.EntityFramework at presentation level?

+7
c # asp.net-web-api entity-framework asp.net-identity-2 3-tier
source share
2 answers

It should be included in your web project.

Microsoft.AspNet.Identity.EntityFramework is a namespace that provides classes to easily connect an identity project to the Entity Framework. It actually gives nothing for EF itself.

If you decide to use another ORM or want to fully configure the asp.net identifier (say, create your own UserStore ) you would not even include this package in your project.

+5
source share

Owin himself has nothing to do with the presentation. This is "authentication middleware." You probably want to install all of these packages in a β€œlogical level” project, that is, a WebAPI.

I suggest you go through the first two parts of the previous version of the above guide .

0
source share

All Articles