I have created an API by specifying HTTP service as a target. The source system will accept the only XML. Since I have added OAuth 2.0 feature in case of Authorization fail the response from Tyk gateway is in JSON format. How to resolve this issue.
Could you provide a bit more information about tglhe request flow and what you need to happen ideally?
Here I have attached the request with invalid Key and the response. I need this response in XML format.
Authorization: Bearer nb3557bfb528d49707bf1d8878a5e19a491447d8679267c193d0621
<oas:Security xmlns:oas=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd” >
<!--You may enter ANY elements at this point-->
“error”: “Key not authorised”
So you want the error response to be in XML? That is not possible without some kind of custom middleware which would hijack the request pre-auth and send back an XML response.
Sorry if i’m not understanding you well
Yes I need response to be XML pre-auth. Do you have any document or blog for the same. Can you elaborate the custom middleware and hijack request part