Added backend check to twofactor primitives