I have a method:
@GetMapping("/foo")
public void> foo(JwtAuthenticationToken token) throws ExecutionException, InterruptedException {
Object object = ReactiveSecurityContextHolder.getContext()
.map(securityContext -> securityContext.getAuthentication().getPrincipal())
.toFuture()
.get();
System.out.println(object);
JwtAuthenticationToken
object which is method argument is succesfully autowired and not null but
result of
Object object = ReactiveSecurityContextHolder.getContext()
.map(securityContext -> securityContext.getAuthentication().getPrincipal())
.toFuture()
.get();
is null.
Could you please explain why ? Is there way to fix it ?
related topic: How to get jwt token value in spring webflux? (to exchange it with Minio STS token)