Refactored the basic authenticator into a generic, asynchronous authenticator