I have an Odata API server that I can't change only access it, I can do CRUD operations on it. However I'd like to authenticate users, that are stored on this server. I can retrieve a user (his email, password everything necessary), now I'd like to authenticate him so I'd probably use JWT tokens. However as I said, I can't change the server implementation, so I thought of making a small microservice, that would have a login (/register) method talking to odata server and returning a JWT token.
Here is how I would imagine it:
My question is, is there a better solution ? Because this one seems like it's an API on top of another API. Also I still need to access the odata api to retrieve other informations I need. So this microservice would be used just for the authentication or should every endpoint first go through my API and then to OData API ?