0

I am trying to capture csrf token and pass as a header in login request but encounter 403 error. I've checked the csrf token extracted from a previous request by using regex extractor and successfully passed as a header of login request. Do not know what the reasons why the login request is failed. Please kindly help.

Trish
  • 1

1 Answers1

0
  1. Double check that you captured the value fully. Also using regular expressions for extracting values from HTML is not the best idea, maybe it worth considering switching to CSS Selector Extractor instead
  2. It might be the case the token in the response is encoded somehow, i.e. URL-encoded or contains HTML escape characters or something like this so try using your browser developer tools to see the token in the response and in the header of the next request and compare them symbol-to-symbol
  3. It might also be the case the CSRF token works fine and the problem is somewhere else, i.e. do you have HTTP Cookie Manager added to your Test Plan
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks a lot for your recommendation. Much appreciated ! I will try all of these and keep you posted. – Trish Feb 23 '22 at 16:56