Behdad
5 years agoContributor
How to use access token in authorization from another API
Hi
I am using JWT token in my Rest APIs and as it has expiration time , i need to refresh/get new token during my test case
So here is an example :
1. first test step --> I create new Token using auth/api-key endpoint
2. second test step --> use this token in another Api endpoint to create new client (/client/create) as access token in authorization
In this case i try to use data transfer between this 2 step , and receive new token but can manage to use it as access token in target !
in between , i am not good in scripting so i prefer to do it via available tools & pages in ReadyAPI 3.5.0
Thanks in advance
- Hey Behdad,
So youre saying youre using the OAuth functionality for your token generation, right....so the token isnt returned in a response payload nor a response header...is that correct?
If that is the case, someone else recently had the same issue and i think i remember HimanshuTayal trying to determine which internal object/property the token value was associated with.
I can't remember if Himanshu sorted it out, but have a search in the soapui AND readyapi! forums for the answer.
Have a look at the following link, and report back your progress
https://community.smartbear.com/t5/SoapUI-Open-Source/Using-context-parameter-in-Request-Authorization/m-p/165001
Ta
Rich