Handle authentication.