hi folks! I asked a more generic version of this in
#server, but thought I’d ask here as well, seeing as this is as far as I can tell a bug/issue in ktor - as long as I’m not just missing some detail here 🙂 ktor-servlet defines the extension function
ApplicationRequest.javaSecurityPrincipal
, in
io/ktor/server/servlet/JAASBridge.kt
which checks if the request
is ServletApplicationRequest
. As far as I can tell, this never works, since the request is always a
RoutingApplicationRequest
that delegates to the original request in
io/ktor/server/routing/RoutingApplicationCall.kt
- i.e. the
is
check doesn’t find the
ServletApplicationRequest
instance, just the
RoutingApplicationRequest
, as
is
does not check for delegates (?). Is this a bug? Or is there some other way to access the principal on the servlet request from Ktor?