AppAuth-Android
AppAuth-Android copied to clipboard
Refreshing tokens when doing multiple API calls
Every time before making an API call, I'm calling performActionWithFreshTokens
to make sure I'm having the latest token, but I'm having a problem when making multiple API calls one after another.
Let's take an example when 2 API calls are made one after the other. Before each API call, I'm doing performActionWithFreshTokens
and updating the tokens if necessary.
The first API call will start refreshing the token, but when the second one is launched, the first one hasn't finished yet so the second one also tries to refresh the token. In the mean time, the first one finished and updates the token. The second one wants to use an old token to refresh and fails.
Do you have a solution for this case?
Sounds like a bug we should fix; we don't have well defined behavior for current requests at present.
Running into this issue as well. Any update on a fix for this?
I forked the app and made the modification myself. As far as I know, there is no fix at the moment.
@FilipMarusca would you mind sharing your fix? would be really helpful for us as well thanks!
take a look at the method perfomActionWithFreshTokens
, the new token is not saved.
It seems that this issue was fixed time ago but it is still open. What is the state of this?