Originally posted by **dwang2** April 7, 2024
I have developed a reactive security service to retrieve the current user's name using the code snippet provided below. How can I formulate a key-cache expression to asynchronously fetch the username
> @Service
public class SecurityService {
public Mono username() {
return ReactiveSecurityContextHolder.getContext()
.map(securityContext -> {
Authentication authentication = securityContext.getAuthentication();
return authentication != null ? authentication.getName() : null;
});
}
}
Given that we are using Spring version 2.7.x, could you please extend support to version 0.8.x as well? This aligns with the current version I'm using.
Discussed in https://github.com/MarcGiffing/bucket4j-spring-boot-starter/discussions/286