I’m currently building a Ktor server that handles two responsibilities:
- It operates an API that requires login to access.
- It handles routing for the front end website.
Setting up jwt auth on the API was fairly straightforward, using this blog post as a guide: Adding Auth0 Authorization to a Ktor HTTP API . However, setting up the routes for /login , /logout and /callback are proving more challenging. There is no dedicated Ktor quickstart, so I looked into the java quickstart. Unfortunately the Java MVC Commons seems to be built around the HttpServletRequest and HttpServletResponse interfaces, while Ktor utilizes its own RoutingCall class (which has its own Request/Response interfaces).
I looked into lifting the logic out of the AuthenticationController#buildAuthorizeUrl and AuthenticationController#handlemethods, but it felt like the servlet interfaces were too embedded for that to be an easy job, or a wise idea.
I was wondering if there was any existing Ktor quickstart, or a guide somewhere on how to build a shim to the existing java quickstart that would allow implementation of Universal Login?
Thanks