Skip to content
Minimal project in Kotlin using Spring Boot 2.2 and WebFlux, showcasing loss of context when switching from a Mono/Flux to a Flow
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src/main
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

webflux-kotlin-sample

This is a minimal project using Spring Boot 2.2 and WebFlux, and written in Kotlin. It showcases a problem that can be encountered when switching from a Project Reactor stream (e.g. a Mono or a Flux) to a Kotlin Flow.

Since Spring Boot is storing the Security Context in the reactive chain returned by the Controller, and I'm transforming this chain into another one before returning it, the context is unfortunately lost.

Usage

First, get the password from the logs. Then run one of the three endpoints, e.g.

curl -u user:$PASSWORD localhost:8080/context

You can’t perform that action at this time.