OAuth Toolkit 4.2 does not return JSON response

Document ID : KB000117078
Last Modified Date : 08/10/2018
Show Technical Document Details
Issue:
When using OAuth Toolkit 4.2 version there is an issue with the "OTK Token DB GET" assertion.
Even when selecting  "Return as JSON?(boolean)" as "True"  the response of this assertion in ${resp.mainpart}  will be JSON structure but its content-type header will be text/xml.
This causes issues, when you try to parse the response.
Resolution:
It has been found that this is caused by a defect in the 4.2 release. We are fixing this in our OTK 4.3.1 release. To receive the fix, you will need to upgrade to that version once it is released.
For the meantime you can use the following workaround:
After, getting the response with invalid content-type, create a new context variable with content-type "json" and use "${resp.mainpart}" as its content.
And then you should be able to parse on that new variable.