Added support for automatic basic authentication