Add more defensive checks and logging to the krb5 authentication code,