added a basic auth function