Sabarish Sathasivan
Sabarish Sathasivan

Reputation: 1276

Exposing ASP.NET Identity Services in DDD

We are developing a DDD based application developed using ASP.NET MVC, C# and EF6. It has been decided to implement the Authentication and Authorization using ASP.NET Identity Service... I have a few doubts regarding that;

Can any one guide me to a good sample implementation?

Upvotes: 4

Views: 1498

Answers (2)

danfromisrael
danfromisrael

Reputation: 3112

I would guess that user management is a different bounded context and that using Authentication & authorization mechanism by some framework in all other bounded context would be an infrastructure responsibility.

Of course you should have an application service interface to authenticate users before driving out some domain logic. That interface implementation would be in the infrastructure (the ASP.NET identity Service)

Upvotes: 1

trailmax
trailmax

Reputation: 35116

  1. I'd say it is Application layer, though this is arguable and what difference does it make? Don't go into Architecture Austronancy and just do it. Auth can be part of domain ("Only Users with Update permissions can change product details", etc.), but it can be insignificant.

  2. Yes you can do a separate DbContext, but you don't have to do it. We used to have all in one massive context, but this proven to be too much and difficult to work with and we are now splitting DbContexts into slices, including Identity DbContext.

Upvotes: 1

Related Questions