I'm working on a web and mobile application for a taxi company and I use React.js and React-native for the front-end as well as ASP.NET Core for the back-end. I try to follow the onion architecture to build the web api but I have a problem for this part, it's about how to use in the best way ASP.NET Identity with this kind of architecture without going against the idea of the onion.
Like I need to authenticate and authorize the users for the access or not to a particular endpoint of my api, I thought of using Identity for doing this job. But I also need to have a User
entity in my application domain to be able to link a customer or taximan to a specific taxi ride and make business logic with this entity. So, my problem is how to link Identity and my domain model without having a reference in my core project ?
I thought to use a mapper between the AppUser
of Identity, who would be in its own infra project and the User
core entity but I don't know if it's a good idea and even how to actually implement it.