I have two service connected to a registry, one of them need to query some data from the other, the token need to be passed to the endpoint.
I Have tried the following but it didn't work, the endpoint act as if no token is provided.
@GetMapping("/api/users/find")
@Headers("Authorization: Bearer {token}")
Optional<UserDTO> findUserByEmail(
@Param("token") String token, @RequestParam("email") String email);
@GetMapping("/api/users/find")
Optional<UserDTO> findUserByEmail(
@RequestHeaders("Authorization") String token, @RequestParam("email") String email);
@GetMapping("/api/users/find")
Optional<UserDTO> findUserByEmail(
@HeaderMap Map<String, Object> headers , @RequestParam("email") String email);
Should work like this @RequestHeader(value = "Authorization") String authorization
, but make sure you pass the right value, must be something like Bearer token
.