JSON Token Generator for JMeter

I am trying to compare the JWT value returned by an API call to the expected valid value in JMeter. To do this, I need to generate the expected value in the pre-processor (either the BSF pre-processor or the Bean shell pre-processor), and then compare it with the value retrieved from the call response. Has anyone created something like this before? I am currently using http://jwt.io/ to manually generate the expected values, but would like to dynamically generate these values ​​in JMeter.

+5
source share
2 answers

Unfortunately, at the moment there is no ready-made solution for processing JWT-signed requests in JMeter.

, :

  • gatling JMeter. Gatling - gatling-jwt - , GET.

  • , HTTP- REST Sampler JWT, java- JWT - OAuth Sampler OAuth.
    , , - .

  • JWT- , , .
    , Pre- PostProcessors .
    :

    • JSR233 ( PreProcessor PostProcessor) + Groovy Beanshell ( . );
    • java- JWT ;
      jjwt , ;
    • JWT- PreProcessor, , HTTP- Body PostProcessor;
      HTTP Request // your http call
      Body Data = ${jwtSignedBody} // variable with request body already signed in pre-processor
          JSR233 PreProcessor // sign here your body data and put into variable
          JSR233 PostProcessor // decode JWT-signed response
      
    • PostProcessor , script .
+2

, , jwt Jmeter - . jmeter jwt RS256 plz?

0

All Articles