Add authenticator framework, fix reading bug