How can I update macos from app store that does not support 2fa?

I have a machine with Yosemite currently and I aim to install Big Sur on it.

Unfortunately, even after I found the secret link to Big Sur on the app store, I'm not able to "get" it because I cannot log in with my Apple ID. It fails with a red error message saying:

 MZFinance.BadLogin.MacAppStore_Message

I'm able to log in online with the same credentials.

I'm assuming this is because 2FA was added after Yosemite/the bundled version of the app store, but I might be wrong. It seems I can only disable 2FA on a device, not online.

This presents an interesting conundrum; I cannot bypass 2FA without a newer OS, which I cannot get without using 2FA? Maybe there is another way?


Usually when you want to login with 2FA on a non-2FA supporting Mac OS version, you can login first with just the password to get the 2FA code on your secondary device. Then you login again with the 2FA code appended after your password.

So if your password is "secret" and the 2FA code is "123456" then your password becomes:

secret123456