Establish a connection and get authenticated