4

Hi I'm starting a project using DDD.

I would like to use Asp.Net Identity for user authentication but IdentityUser this very coupled to Asp.net and a domain model object should not have dependencies.

This is leading me to think that authentication may be a different BoundedContext that is not implemented using DDD.

I would like to know if anyone has been in the same situation and what options you think I can have.

thanks

1 Answer 1

3

For me it is fine to implement authentication without using DDD. DDD way is time consuming/expensive and it's fine to use it only to your core domain (code that has most business value).

And remember that if you want to separate yourself from frameworks you can always hide yourself behind Interface. In this case your business layer may declare IIdentityProvider with methods that your business layer require. Then you can provide concrete implementation of this provider AspIdentityProvider: IIdentityProvider in your website layer. Then AspIdentityProvider might be injected to classes in business layer that require it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.