Project: mule
Issue MULE-7577: OAuth regression - RC1 OAuth connectors not working at all
I found the issue in the org.mule.security.oauth.util.HttpUtilImpl#post(String, String) method. The refactor made to improve the exception error (MULE-7521) modified the way of working with the OutputStreamWriter (look for "out" variable). After doing the #write(String) there is no flush(), hence the stream is not filled with the API response, and the response is always an error. The code is: {code} //.. try { out = new OutputStreamWriter(conn.getOutputStream()); out.write(body); int responseCode = conn.getResponseCode(); //.. } //.. {code} when it should be {code} //.. try { out = new OutputStreamWriter(conn.getOutputStream()); out.write(body); out.flush();//magic happens here int responseCode = conn.getResponseCode(); //.. } //.. {code} This should solve all the issues with OAuth support for DevKit connectors.
Story points: 1