Added basic authentication funtionality.