title: How to get bearer token from header of a request in java spring boot?
body: <p>Hi what trying to achieve is to get bearer token that submited from front end in java spring boot RESTApi controller and do another request using feign client to another microservices? here is what i do</p>
  <p><a href="https://i.stack.imgur.com/4bU6m.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4bU6m.png" alt="enter image description here" /></a></p>
  <p>image above is how i do my request from postman, and here is my controller code :</p>
  <pre><code>@Operation(summary = &quot;Save new&quot;)
  @PostMapping(&quot;/store&quot;)
  public ResponseEntity&lt;ResponseRequest&lt;TransDeliveryPlanning&gt;&gt; saveNewTransDeliveryPlanning(
          @Valid @RequestBody InputRequest&lt;TransDeliveryPlanningDto&gt; request) {
  
      TransDeliveryPlanning newTransDeliveryPlanning = transDeliveryPlanningService.save(request);
  
      ResponseRequest&lt;TransDeliveryPlanning&gt; response = new ResponseRequest&lt;TransDeliveryPlanning&gt;();
  
      if (newTransDeliveryPlanning != null) {
          response.setMessage(PESAN_SIMPAN_BERHASIL);
          response.setData(newTransDeliveryPlanning);
      } else {
          response.setMessage(PESAN_SIMPAN_GAGAL);
      }
  
      return ResponseEntity.ok(response);
  }
  </code></pre>
  <p>and here is how my service look like :</p>
  <pre><code>public TransDeliveryPlanning save(InputRequest&lt;TransDeliveryPlanningDto&gt; request) {
         Future&lt;List&lt;PartnerDto&gt;&gt; initPartners = execs.submit(getDataFromAccount(transDeliveryPlanningDtSoDtoPartnerIdsSets));
  
  }
  
  public Callable&lt;List&lt;PartnerDto&gt;&gt; getDataFromAccount(Set&lt;Long&gt; ids) {
  
      String tokenString = &quot;i should get the token from postman, how do i get it to here?&quot;;
      List&lt;PartnerDto&gt; partnerDtoResponse = accountFeignClient.getData(&quot;Bearer &quot; + tokenString, ids);
      
      return () -&gt; partnerDtoResponse;
  }
  </code></pre>
  <p>as you can see, in &quot;tokenString&quot; there i put a string that i questioned about, how do i get it to there from postman?</p>