Check for BadRequest too when retrying authentication - fixes #21