Basic authentication from scratch