lib: add hostbased user authentication support