Authenticate when username and password are present.