Apache authentication doesn't work
See original GitHub issueI use Basic Authentication module with ktor client and Apache HTTP. The authentication module fails to insert Authorization
header field due to following code:
The status code responded from Apache creates HttpStatusCode("401","")
but it compares with the pre-defined status code, which is HttpStatusCode("401","Unthorized")
, and it is structurally not equivalent.
Sorry I’m not sure if should also put a question here, but it’s related though…
The way authentication works here from my understand is it tries to call the endpoint once and check for Unauthorized
before inserting the Authorization header. This doesn’t make sense to me, if a dev configures HTTP client for authentication, it should mean they expect them to happen, shouldn’t it? Why should the client makes the double calls to do so?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
For the folks arriving here and wondering how to fix it, it was visibly fixed in later versions, but you eventually need to add the “sendWithoutRequest = true” in your basic auth configuration (e.g. : https://api.ktor.io/1.3.1/io.ktor.client.features.auth.providers/-basic-auth-provider/)
Could you file a separate issue?