Demo code for secure authentication