Moved code for sasl authentication.