Agent authentication added

Updated Agent to authenticate as well, class features will be merged
shortly.