Implement basic authentication logic