let's say we have a lot of microservices in backend. There is gateway API service that authorize user to execute some action done in UI. Than that's microservice (MicroBackend1) calls next microservice(MicroBackend2) and next one calls next one. What JWT should be passed to authorize between MicroBackend1 and MicroBackend2? Which approach i the right one:
JWT from UI user is passed only to first MicroBackend1. Than it passed his own JWT to MicroBackend2. Context knows context of user that executed action in UI is not available in MicroBackend2.
MicroBackend1 does the ActAs token request to STS and then passes new JWT to MicroBackend2. This means user context is known to MicroBackend2.
MicroBackend1 directly passes JWT that he got from UI to MicroBackend2 therefore it has user context.
What are the pros and cons of such solutions? Which one you have tried and which one should we choose?