Add AUTH support, fixes #383.