-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Spring Webflux 5.2.0.M2 - Kotlin coroutines - ServerRequest.awaitPrincipal always null #22986
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
Comments
I forgot to mention (and it's missing in the example application), in tests with Spring Security's |
After a bit more of research this seems to boil down to the |
As discussed on Kotlin side, this depends on Kotlin/kotlinx.coroutines#284. |
Moving this one to RC2 since Reactor - Coroutines context is not complete yet, see Kotlin/kotlinx.coroutines#284 (comment) for more details. |
This issue is supposed to be fixed by Coroutines 1.3.0-RC2, to be verified asap Spring Boot has switch on Spring Framework 5.2 snapshot. |
I confirm it now works as expected. |
I tested this with Spring Boot 2.2.0.M6 in my project and can also confirm it works now! Thanks a lot! |
Uh oh!
There was an error while loading. Please reload this page.
When using a suspend HandlerFunction
req.awaitPrincipal()
always returns null for me.I created a new application with Spring Boot 2.2.0.M3 and the spring-webflux and spring-security starters. It has one coroutine based handler function and a "classic" one, both using the principal. The coroutine always gets null when calling
req.awaitPrincipal()
, butreq.principal()
works in the "classic" handler.Using curl:
Is there some misunderstanding on my side or is this a bug?
Full example application is attached: principal-coroutine-null.zip
For completeness, here is the stacktrace:
The text was updated successfully, but these errors were encountered: