Do not try to authenticate when no credentials are set.
Set error_message in every case we return 0.