When I enter the suspend function, the context is present. This function is called from a controller function that is also suspend.
suspend fun search(searchRequest: String): String? {
val context = ReactiveSecurityContextHolder.getContext().map {
it
}.awaitFirstOrNull()
log.info("The context here at the search is $context")
return someJava.something();
}
As soon as I get into java code the context is gone in java. If I call back into kotlin the security context is still gone.
public String something() {
return someKotlin.something();
}
fun something(): String {
val context = ReactiveSecurityContextHolder.getContext().map {
it
}.awaitFirstOrNull()
log.info("The context here is always null. Why? $context")
}
Any idea how to resolve this issue?