How authentication operates