Fix Microsoft 365 Sign-In, OneDrive Sync, and AADSTS20012 Errors
Question details
Resolve Microsoft 365 sign-in and OneDrive synchronization problems associated with an AADSTS20012 error.

- Product
- Microsoft 365 and OneDrive
- Device & OS
- not provided
- Scenario
- A user signs in to Microsoft 365 through an organization's federated sign-in system and tries to use Office and sync OneDrive files.
- Observed behavior
- OneDrive may fail to sync, Office may repeatedly request sign-in or show an Unlicensed Product message, and authentication may return an AADSTS20012 invalid WS-Federation error.
Note when the error started and copy the error details, including any timestamp and correlation ID. Check whether you can sign in at microsoft365.com using your work or school account.
Check Whether the Federated Sign-In Problem Affects Other Users
Use these checks to help your organization's support team determine whether the issue is local or affects the federated sign-in service.
Open microsoft365.com in a browser and try signing in with your work or school account. If available, also try Outlook on the web.
Ask a colleague whether they can sign in, and note whether the error occurs on a domain-joined computer, outside the organization, or both.
Send your school or Microsoft 365 support team the AADSTS20012 message, timestamp, correlation ID if shown, and the results of your web and OneDrive checks.
Once support confirms the sign-in issue is resolved, sign in to Microsoft 365 again and check the OneDrive sync icon for remaining errors.

Review Federated Sign-In Configuration as an Administrator
Use this approach if multiple users are affected or the Microsoft 365 portal also fails to authenticate.
Keep Working on Office Files with WPS Office
WPS Office is a free, lightweight, easy-to-use alternative with a familiar interface and Microsoft Office format support for a smoother move between suites. It does not repair Microsoft 365 federation or OneDrive sign-in.

Frequently Asked Questions
What does AADSTS20012 mean?
AADSTS20012 indicates an invalid WS-Federation request during sign-in. Your administrator can review the identity provider and federation logs to identify the cause.
Why does OneDrive stop syncing when Microsoft 365 sign-in fails?
OneDrive needs to authenticate your account to sync files. If federated sign-in fails, it may be unable to obtain or renew access until the sign-in issue is resolved.
What should I send my Microsoft 365 administrator?
Send the error message, the time it occurred, any correlation ID, and whether you can sign in at microsoft365.com or Outlook on the web. Mention whether other users or locations are affected.
Does an Unlicensed Product message always mean my license was removed?
No. Office may be unable to verify a license because sign-in is failing. Ask your administrator to check both your account's license assignment and the sign-in issue.




