Working implementation of HTTP Basic Auth