As suggested here:
modifying the generated code to use WinHttpHandler rather than HttpClientHandler worked for me.
I also had to turn off using the default credentials, add a new Network Credential to the handler.
var httpClientHandler = new WinHttpHandler()
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
AutomaticRedirection = true,
ServerCredentials = new NetworkCredential("myUser", "myPassword, "myDomain")
};