ktor client bearer token auth plugin supports oaut...
# ktor
b
ktor client bearer token auth plugin supports oauth tokens and synchronized refresh; I'm going to run more than one server at a time: how do I ensure that a refresh token is only leased once at most? from what I've read people use distributed locking mechanisms, e.g. through redis
a
The
Auth
plugin ensures the token is refreshed only once, even when several requests get 401 concurrently — the remaining requests suspend until the refresh is finished and are retried with the new token.
a
Also across servers?
a
Yes. The plugin synchronizes the tokens within the client it's installed into.
b
right, there's one client per server