How to structure a solution separating WebApi from WebUI using ASP.NET Identity?

8

How should a solution be organized that will have at least three projects, such as:

  • Class Library as Infrastructure
  • Web Application as Web Api
  • MVC Web Application for WebUI (user interface)

Where ASP.NET Identity will be used as an authentication and access control component.

Or, does something from ASP.NET Identity go in the WebUI (Asp.Net MVC) project? What?

    
asked by anonymous 20.11.2014 / 01:58

2 answers

2

The form I use is:

  • MeuProjeto.Dominio (Models, Enums, Helpers and Non-Visual Extensions, ASP.NET Identity);
  • MeuProjeto.MVC (Controllers, Views);
  • MeuProjeto.WebApi (ApiControllers).

Both the Entity Framework and ASP.NET Identity must be installed in the domain. ASP.NET Identity must be installed in the MVC and Web API applications, at least the Core and OWIN packages.

    
12.07.2016 / 16:52
2

The ideal is to isolate your AspNet Identity from your main project as it has responsibilities and rules that belong to it and should not be mixed with your application.

The implementation of AspNet Identity is not a layer of your solution, it is part of your infrastructure, having a "behavior" of CrossCutting .

I have in my GitHub repositories a sample WebApi with Isolated Identity project. It is complete, even has a web project running a SPA application just consuming WebAPi.

    
16.08.2016 / 15:23