I was trying to log into my microsoft account while playing Forza Horizon 4 on my Steam Deck and had a world of hurt.
No matter what I did, I couldn’t log into my account. And its all thanks to Multifactor Authentication (2FA).
Log into your Microsoft account from something other than your steam deck or xbox.
On the left side, click security and then Manage how I sign in

You’ll want to remove any 2FA, such as text me a code, that you have setup.

Now you’ll be able to log into your game!