I am building a microservice that implements OAuth 2 for user authentication. My doubt is that if the topic of retrieving the information of the current user (Example: /users/me obtains the user data encoded with json), it should be implemented in the same microservice or they should go in different microservices following the Domain Driven Design pattern.
It would depend on your services architecture, how your domain is organized. But generally speaking, it makes sense to have Authentication server outside your UserData micro service because
But on the other hand, if your application requires user data to be part of the auth response payload or if you don't plan to have a lot of micro services, it would make sense and easier to implement in the same service. Maintaining a service boundary with persistence layer separation helps if you plan to split them in the future.