Hey everyone, I'm using Ktor and have set up Diges...
# ktor
a
Hey everyone, I'm using Ktor and have set up Digest Authentication. But when I use status pages plugin:
Copy code
install(StatusPages) {
    statusFile(HttpStatusCode.Unauthorized, HttpStatusCode.BadRequest, filePattern = "errors/error#.html")
}

install(Authentication){
        digest("digest-auth") {
            realm = myRealm
            digestProvider { userName, _ ->
                userTable[userName] 
            }
            validate { credentials ->
                if (credentials.userName.isNotEmpty()) {
                    CustomPrincipal(credentials.userName, credentials.realm)
                } else {
                    null
                }
            }
        }
    }
the
WWW-Authenticate
response header is missing, which breaks the Digest Authentication flow. If I remove
statusFile(...)
, the header is included, and everything works fine. Is there a way to use
statusFile(...)
without losing the
WWW-Authenticate
header
? Or is this expected behavior? Would appreciate any insights. Thanks!
a
This is a bug, so I've filed an issue.
👍 1