https://kotlinlang.org logo
#ktor
Title
# ktor
z

Zhiqiang Bian

01/12/2022, 4:36 PM
Hi, I have a question on Ktor-Client 1.6.7 Bearer token. Is it possible to customise the condition of calling
refreshTokens
function? For example, without the
WWW-Authenticate
header? https://ktor.io/docs/auth.html#bearer
Copy code
3. Specify how to obtain a new token if the old one is invalid using refreshTokens. Note that this block will be called after receiving a 401 (Unauthorized) response with the WWW-Authenticate header.
d

duuusha

01/13/2022, 7:58 AM
Hi, currently it is not supported - here is an issue about it: https://youtrack.jetbrains.com/issue/KTOR-3516
🙏 1
p

ptsiogas

02/18/2022, 8:45 AM
Very handy request. Is there a workaround until a final solution is ready?
In case someone has the same problem I posted a workaround solution here until there is an official support.
🙌 1
6 Views