Authplugins and AD Improvements

These are the merged changes of  #132 #126 and #74