Describe the bug I have an endpoint:
@GetMapping("/someEndpoint")
public Mono<Boolean> bucketExists(JwtAuthenticationToken token) throws ExecutionException, InterruptedException {
Object object = ReactiveSecurityContextHolder.getContext()
.map(securityContext -> securityContext.getAuthentication().getPrincipal())
.toFuture()
.get();
System.out.println(object);
prints null
To Reproduce
just call the endpoint
Expected behavior
Object object contains JWT
Actual behavior
Object object is null
BTW:
JwtAuthenticationTokenobject which is method argument is succesfully autowired and not null
related SO topic: https://stackoverflow.com/questions/74921888/how-to-get-raw-token-from-reactivesecuritycontextholder
Comment From: jzheaux
Duplicate of #12442.
Also, I responded to your SO post: https://stackoverflow.com/a/74999369/2243324 and I also commented on https://stackoverflow.com/a/74967795/2243324
Comment From: gredwhite
jzheaux Unfortunately your answer doesn't respond to my question