added code for basic authentication