this needed to be updated to distinguish between different kinds of authentication failures