Authentication Complete with error handling