Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC authentication for websockets doesn't work in 1.13.* #16602

Closed
oberstrike opened this issue Apr 17, 2021 · 7 comments · Fixed by #20157
Closed

OIDC authentication for websockets doesn't work in 1.13.* #16602

oberstrike opened this issue Apr 17, 2021 · 7 comments · Fixed by #20157
Labels
Milestone

Comments

@oberstrike
Copy link

oberstrike commented Apr 17, 2021

As @devauxbr mentioned, the bug is not related to Kotlin and may be fixed in the future.

@oberstrike oberstrike added the kind/bug Something isn't working label Apr 17, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 17, 2021

/cc @evanchooly

@sberyozkin
Copy link
Member

Hi @oberstrike It is hard to do anything about this issue without a reproducer - please create the one for us to have a look

@oberstrike
Copy link
Author

@sberyozkin its really hard to make a reproducer because it has so many dependencies like keycloak configuration etc. But I'll try my best to do one.

@devauxbr
Copy link
Contributor

Hello

I have encountered the exact same issue while upgrading my WebSocket Quarkus app to 1.13+
I don't use Kotlin, but my app relies on a custom HttpAuthenticationMechanism. I managed to create a minimalistic bug reproducer here

I've been quickly digging through the new quarkus-websocket extension source code. From what I understand, the old extension relied on the legacy Undertow Servlet WebSocket implementation that got the WebSocket Session Principal correctly populated from the Servlet layer. The new Vertx implementation does not retrieve the Principal yet (as this todo suggests)

Hope this helps ! 🤞

@oberstrike oberstrike changed the title Kotlin - Keycloak authentication does not work in 1.13.* for websockets. OIDC authentication for websockets doesn't work in 1.13.* May 15, 2021
@oberstrike
Copy link
Author

Now they have passed 2 month since we found out what the problem is. When will the problem be fixed? Or is there a workaround exist?

@aldoborrero
Copy link

Care to comment @stuartwdouglas ?

@aldoborrero
Copy link

aldoborrero commented Sep 13, 2021

Playing around with the code and thanks to @devauxbr initial cursory research, inside VertxWebSocketHttpExchange we do have access to the original RoutingContext in the class attribute exchange.

image

Upon closer inspection, I can see the principal is correctly populated inside the exchange.data() map like we can see below:

image

Is it safe to assume that we can return directly that object in method getUserPrincipal? Or is there any other implication I'm not taking into account (which will be probably)?

Something like:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants