Apple TV can't login to iCloud

It turns out this is what happens when you have 2FA enabled. The solution is to get a verification code from an iOS device. Then use this 6-digit code together with your password on the AppleTV. So if my password is mypassword then I would enter like mypassword123456.

Settings > Apple ID > Password & Security > Get Verification Code

enter image description here