Added support for authentication.