When testing failure scenarios for token the InvalidTokenException is being sent back as XML instead of JSON. I get the following:
<InvalidTokenException><error>invalid_token</error><error_description>Cannot convert access token to JSON</error_description></InvalidTokenException>
when I expect JSON. Is there some config option I'm missing here?
any resolution of config option for JSON serialization?
setting header attribute "Accept" : "application/json" solved the problem. Is there any better way to implement this as default behavior. I tried to override WebMvcConfiguration to set content negotiation strategy as FixedContentNegotiationStrategy with default content type as "application/json", which didn't work.
@kshitij-kasliwal Did you get any workaround on this ?
Most helpful comment
setting header attribute "Accept" : "application/json" solved the problem. Is there any better way to implement this as default behavior. I tried to override WebMvcConfiguration to set content negotiation strategy as FixedContentNegotiationStrategy with default content type as "application/json", which didn't work.