-
Notifications
You must be signed in to change notification settings - Fork 378
Closed as not planned
Closed as not planned
Copy link
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com
Description
Currently we're trying to migrate our R2DBC application to JDBC because the MSSQL driver seems to be completely unusable. Right now everything looks fine except user auditing information. It seems the the security context information is simply missing if you try to access the ReactiveSecurityContextHolder from a AuditorAware implementation which @EnableJdbcAuditing seem to require.
To wrap our blocking calls we use this simple pattern
Mono.fromCallable { thingRepository.save(Thing()) }
.subscribeOn(Schedulers.boundedElastic())and our JDBC configuration looks like
@Configuration(proxyBeanMethods = false)
@EnableJdbcAuditing
class JdbcConfiguration {
@Bean
fun auditorAware(): AuditorAware<String> = AuditorAware {
ReactiveSecurityContextHolder.getContext()
.map { it.authentication.name }
.defaultIfEmpty("NOTHING")
.blockOptional()
}
}We've had a look at the reactor context and it seems that it is properly filled in our code but missing in the AuditorAware. Do you have any suggestions how we can bridge blocking auditing with reactive security?
Metadata
Metadata
Assignees
Labels
for: stackoverflowA question that's better suited to stackoverflow.comA question that's better suited to stackoverflow.com