Allow set custom authentication errors.

This patch allow send authentication errors, for example, when overriding default 'authenticate' listener.