Implement basic authentication. Fix Mono build.