I have developed a new project based on ASP.Net core. I have moved all my EF code (Models,mappings, DbContext) into a dedicated DAL class library in order to follow the Single responsibility principle of the SOLID rules.
However, I need now to add authentication into my project and would need to add the following into my Startup.cs of my Web project as shown in different tutorials:
services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
It would involve adding the Microsoft.AspNetCore.Identity.EntityFrameworkCore package and it seems to me that I start breaking the SRP rule by having this package included into my Web project.
Would it possible to move all the identity code (Services, models) as an external class library as I did for the DAL.
I'm having my own research about the exact same question, found this thread you can read about the implementation here, although it is not related to .NET Core class library in particular. I believe the principal is similar and you can find your way through it. I also assume that it is not has to be implemented via a web app application as mentioned here.