Fix replication auth

Set credentials to the HttpClient if available. This code is somehow missing probably due to the merge process.