Fix ExternalAuthenticationServer and its tests