kgrzybek / modular-monolith-with-ddd

Full Modular Monolith application with Domain-Driven Design approach.
MIT License
10.89k stars 1.71k forks source link

How to handle multi-tenant authentication? #222

Open maxinmos opened 3 years ago

maxinmos commented 3 years ago

In project domain, after users register, other domains will replicate users' info into their database.

I am still not clear how to do if users belong to only one or two domains? For example, with streaming platform, it includes identity, advertising and streaming domains. However, there are very few accounts use the function of advertising.

kadmis commented 3 years ago

I suppose you could separate user registered events by the user role? That way your modules subscribe only to events of one type of user and you may then apply different behavior based on the user role.