Open the connection and authenticate