quarkus-keycloak-authorization will break quarkus-websockets. Why? #30905
-
When quarkus.keycloak.policy-enforcer.enable=true is set, the websocket with the path in keycloak authorization will not able to be connect. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 41 replies
-
/cc @pedroigor (keycloak), @sberyozkin (keycloak) |
Beta Was this translation helpful? Give feedback.
-
keycloak-authorization requires a verified OIDC token to function |
Beta Was this translation helpful? Give feedback.
-
@sberyozkin @sberyozkin Perhaps the policy enforcer should only handle REST requests? |
Beta Was this translation helpful? Give feedback.
-
@SetoKaiba For example, #30427. |
Beta Was this translation helpful? Give feedback.
-
Would you mind linking to a WS-only application which confirms you have the custom property retained after the upgrade ? |
Beta Was this translation helpful? Give feedback.
-
@SetoKaiba Your WS code looks fine, thanks. Please confirm that you can also get the identity available in
Lets confirm first So confirm please |
Beta Was this translation helpful? Give feedback.
-
Can you clarify please with the example (CC @pedroigor )
Hi @manovotn @mkouba, I recall we were discussing awhile back how to correctly handle the request scope propagation through the diff thread contexts, is it about having |
Beta Was this translation helpful? Give feedback.
-
Makes sense to create a bug (or enhancement) request as I'm not sure the context propagation was meant to support WS calls. |
Beta Was this translation helpful? Give feedback.
@SetoKaiba Your WS code looks fine, thanks. Please confirm that you can also get the identity available in
onMessage()
which is critical. If that works, then it is great, you have WS and OIDC working. It will be definitely worth documenting, I proposed it to the user who provided a similar solution earlier, but I'll have np documenting it myself.Lets confirm first
onMessage()
can access a non-anonymous identity.I honestly have no idea right now why KC enforcer is not seeing it. Or if https://github.com/quarkusio/quarkus/blob/main/extensions/keycloak-authorization/runtime/src/main/java/io/quarkus/keycloak/pep/runtime/KeycloakPolicyEnfor…