Handle authentication process