make authentication function async
basic support for .htpasswd