Only treating status code 401 as authentication failure in all auth modes