Things to try:
1 – Change Group Policy to ensure that Windows Updates are automatically installed during the 3rd Sunday of every month at 3am.
- Group Policy: Enabled Windows Updates, install on the third week of the month on a Sunday at 3:00am, also configured to install updates for other Microsoft products
- This should include Office and OneDrive updates
- Group Policy: Automatic Updates Detection Policy – Enabled, Interval hours – 12
- Group Policy: Allow Automatic Updates Immediate Installation Policy
- Read more – https://answers.microsoft.com/en-us/msoffice/forum/all/onedrive-wont-sign-in-on-server-2019solved/d31cac37-1429-4b2d-9197-8c0782b573fa
2 – Registry change
- Browse to Computer\HKEY_CURRENT_USER\Software\Microsoft\OneDrive and delete all registry entries including subfolders
- Reinstall OneDrive then reboot system
- Read more – https://learn.microsoft.com/en-us/answers/questions/933177/onedrive-error-1200
3 – Delete the subfolders within the OneAuth and Identity Cache folders in the locations below
- Press Window symbol + R then paste the 2 locations below
- %localappdata%/Microsoft/OneAuth
- %localappdata%/Microsoft/IdentityCache
- Read more – https://answers.microsoft.com/en-us/msoffice/forum/all/my-onedrive-access-does-not-work-any-more-gives-me/2ac55e7e-82a3-46a9-adc9-31b59d51dd90
It should work! If you ever run into this issue again, try step 3 first and then step 2 as a last resort.