DevOps Automation

 View Only
  • 1.  How to put a Bearer token Authentication in Json request - Rational Performance Tester

    Posted Fri April 07, 2023 02:25 PM

    Hi

    I am using Rational Performance Tester, and I have 2 services in Json: service A and service B.

    The service A's response gets a Token, and I want to pass that token as an authentication (Bearer Token) for the service B, how can i do it?

    #RationalPerformanceTester #Rational #json 





    ------------------------------
    Christian
    ------------------------------


  • 2.  RE: How to put a Bearer token Authentication in Json request - Rational Performance Tester

    Posted Thu April 13, 2023 04:04 PM

    You can set the token in the first service test to a variable.
    1.  Highlight the token, right click and create a reference.
    2.  Create a varialbe in the Variables section and make sure it is of scope user.
    3.  Add a variable assignment to the test for your declared variable and assign the variable to the reference you created.
    4.  In your second test declare the same variable of type user.
    5.  Go to the place in your second test where you want to use the token, highlight it, right click and say substitute from->variable name.

    This should get you going.  If you run into problems please feel free to open a support ticket.



    ------------------------------
    Dawn Peters
    ------------------------------



  • 3.  RE: How to put a Bearer token Authentication in Json request - Rational Performance Tester

    Posted Thu April 13, 2023 04:04 PM

    The screenshots are from recording.  The details on how to pass the token during recording will be specific to your application.  For playback, you could pass the token between two tests by 1) Extracting the returned token using a data correlation reference; 2) Add a test variable to your test and assign it a value from the reference; 3) Substitute the recorded token with the variable.



    ------------------------------
    Scott Didier
    ------------------------------



  • 4.  RE: How to put a Bearer token Authentication in Json request - Rational Performance Tester

    Posted Tue August 22, 2023 12:57 PM

    Hello,

    Make sure that you have a Request Header as "Authorization" on Service B. If not, click on Add and then add type Authorization, value should be Bearer "token response from service A". Once added, you can now correlate the value for run time.

    Hope it helps !



    ------------------------------
    sudheesh srikantam
    ------------------------------