Two-factor authentication has long been the preferred alternative to simple username-and-password combinations, as it provides much stronger security.