First of all, there are already two questions on the StackOverflow with this same kinda issue this and this which is kinda workaround, not an actual solution.
So there is a ClientInterceptor that is intercepting and attaching the header to the request so if the access token expired the server will respond with an UNAUTHENTICATED status but then how to recall the same method with new access token attached to it.
It is something like an authenticator which is used in retrofit here is the link.
First of all, there are already two questions on the StackOverflow with this same kinda issue this and this which is kinda workaround, not an actual solution.
So there is a
ClientInterceptorthat is intercepting and attaching the header to the request so if theaccess tokenexpired the server will respond with anUNAUTHENTICATEDstatus but then how to recall the same method with newaccess tokenattached to it.It is something like an authenticator which is used in retrofit here is the link.