How to enable (proactive) authentication for custom programmatic reactive routes #46319
-
Hi, how can I enable (proactive) authentication on reactive routes which I added using the Vert.x web router interface
It looks like if I add this router, HTTP authentication from Quarkus security is not triggered. However I can't seem to find a way to register a handler which enables the authentication. (Background; I'm working on a new feature for the Quarkiverse Google Cloud extension to support session based cookies. I need to be able to create a custom route (the user of the extension can configure the endpoint path). The custom routes needs access to the principal created by Quarkus Security to create a cookie based on the JWT Token). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
I believe you should use Quarkus reactive routes, is it correct @michalvavrik ? By the way, not sure if it is relevant, but the Google Cloud project is integrated indirectly with Quarkus OIDC, there is a section about it in the OIDC code flow authentication doc, sorry for not providing a link as I'm on my phone |
Beta Was this translation helpful? Give feedback.
-
I believe we need more context because I don't understand what you try to do and how. For example:
We have loads of tests in Vert.x HTTP deployment module that add a handle and authentication happens.
if it is a route on HTTP router, the HTTP authenticator is present and by default proactive authentication happens.
Use Knowing following context would help:
As for Reactive Routes, they will work and do some work for you regarding CDI context, but your snipped above can work too. |
Beta Was this translation helpful? Give feedback.
I believe we need more context because I don't understand what you try to do and how. For example:
We have loads of tests in Vert.x HTTP deployment module that add a handle and authentication happens.
if it is a route on HTTP router, the HTTP authenticator is present and by default proactive authentication happens.
Use
io.quarkus.vertx.http.runtime.security.QuarkusHttpUser#getSecur…