question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebSocketSession#getHandshakeInfo#getPrincipal returns empty Mono even the user has authenticated

See original GitHub issue

Summary

I think this should be a regression issue, I found this when I upgraded my Spring Boot from 2.0.5 to 2.0.6.

When I subscribe WebSocketSession#getHandshakeInfo#getPrincipal, it always returns an empty Mono even the request has already authenticated.

Actual Behavior

An empty Mono is returned.

Expected Behavior

Should return a Mono that publishes exchange’s principal (like what we were getting in Spring Boot 2.0.5)

Configuration

Please check the demo project below.

Version

Spring Boot 2.0.6.RELEASE

Sample

I’ve created a demo project for this issue: https://github.com/unlimitedsola/spring-security-regression-issue-empty-principal

I also created a branch named 2.0.5 to prove it did work on Spring Boot 2.0.5.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rwinchcommented, Nov 13, 2018

@unlimitedsola No problem 😄 I’m glad it is now working and thanks for following up so quickly

0reactions
unlimitedsolacommented, Nov 13, 2018

Thanks for your quick response, after running with --refresh-dependencies, the latest snapshot of reactor-netty worked for me. Sorry for disturb 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to perform an action only if the Mono is empty and throw ...
I call a method on the repository layer that will find a user by username and if not found it will return an...
Read more >
Build Reactive APIs with Spring WebFlux - Okta Developer
This operation returns a Mono<T> . Both Mono<T> and Flux<T> support chaining processing with the thenMany(Publisher<T>) method.
Read more >
Flux.collectList() returns empty list when was called in a chain ...
collectList() is executed, and it turns our chain into a Mono with an empty List inside, but not an empty Mono anymore.
Read more >
Web on Reactive Stack - Spring
You can return reactive types (Reactor, RxJava, ... attribute was returned) or an async return value (for example, Mono completed empty).
Read more >
Kotlin Mono Examples - YouTube
Get started with reactive programming using Project Reactor in Spring Boot. This video looks at the Mono reactive type with examples in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found