I have different microservices developed in Hapi+Molecular. I used hapi-moleculer npm module to add molecular in hapi, I am using redis as transported to communicate between services. I can call functions of service A from service B... what i need is to add authentication to call functions of other services. Like if Service A calling function of Service B it needs to authenticate to prevent others from connecting to my services. I am calling servies like this
request.broker.call('users.logout', { });
I saw a module imicros-auth for this but i didn't found it much useful is there anyother module which can do this or is there any better approach to custom code for service to service authentication. It should be like
If service is calling its own function, then no auth required, if calling function of other service then it must be authenticated One more thing it should not be like fetching auth from db or some kind of this which makes response of service slow, can be token based or something like this