I am looking for the best practice to do authentication (login) and signup using microservices, given that microservices are not supposed to share the same data.
At the moment I am thinking:
- Two services: Signup and Auth
- Signup registers users, calls email service to verify, then informs Auth of user creation
- All login operations are handled by Auth from then on
Problems with this are: should Signup only temporarily store the data until the email is verified? Or should both Signup and Auth store a version of the data. Should Signup directly call auth to inform of the new user (how to authenticate this call?)? Or should a communication layer such as Kafka be used, although that seems overkill?
I am looking for something more precise than this answer.