title: How to set CSRF token in Postman
body: <p>I am using Spring Boot 2 and Spring 5 in order to create an app that saves two entities: User and UserProfile. This is my controller class: </p>
  
  <pre><code>@RestController
  @RequestMapping("userProfile")
  public class UserProfileController {
  
      @Autowired
      private UserProfileService userProfileService;
  
      @PostMapping(produces = "application/json")
      @ResponseStatus(HttpStatus.CREATED)
      public void createUserProfile(@RequestBody @Valid UserProfileDTO userProfileDTO, @AuthenticationPrincipal User user){
  //code 
      }
  
      @GetMapping
      public ResponseEntity getUserProfile(@AuthenticationPrincipal User user){
          //code
      }
  }
  </code></pre>
  
  <p>Nothing fancy, I get the authenticated user and I set that and save it or I fetch the data based on the authenticated user. My security configuration is: </p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Autowired
      private UserDetailsService userDetailsService;
  
      @Bean
      public PasswordEncoder passwordEncoder() {
          return NoOpPasswordEncoder.getInstance();
      };
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
      }
  
  }
  </code></pre>
  
  <p>Now I want to test with Postman. The GET works fine, I add the form data in Postman and it authenticates and I can debug the get method. POST is always identified as 403 Forbidden. I don't want to disable CSRF or/and cors. How can I test my application, fetch the CSRF token and set it in Postman? </p>