Added support for token authentication.