agent: Adding a parameter to give the error name to authentication callback