How can i workaround missing WWW-Authenticate http header in Ktor Client?

Viewed 390

i am using Ktor Client 1.6.0 to communicate with backend REST API which i do not control. For Authentication i am using Bearer https://ktor.io/docs/auth.html#bearer but refreshTokens never calls because of 401 unauthorized response do not contains http header WWW-Authenticate. The header is required to run refreshTokens https://github.com/ktorio/ktor/blob/main/ktor-client/ktor-client-features/ktor-client-auth/common/src/io/ktor/client/features/auth/Auth.kt#L46

Is it possible to somehow add this header manually before the referenced part of code in Auth.kt calls?

Link to similar question in backend part https://developer.mongodb.com/community/forums/t/missing-http-header-www-authenticate/110569

0 Answers
Related