You might run into the problem that the XBOX app doesn't allow you to log-in. This only happens if you download it from the Microsoft Store, so uninstall that version.
Instead, download it directly from the xbox website, and it will work perfectly. There is other fixes in "Services" and such, but those all didn't work and were much more complicated than this.
Link:https://www.xbox.com/en-US/apps/xbox-app-for-pc
Enjoy"