First post: Onedrive login error – AADSTS50020

Let’s start off with an easy one..

Problem:

The user accessed Sharepoint via portal.office.com with his/her work credentials. To sync the needed folder with explorer within windows the user clicked the Sync button. After logging in with the same credentials used via the web portal, the following error occurred: Message: AADSTS50020: User account ‘xxx@xxx.nl from identity provider ‘https://sts.windows.net/xxxxx/’ does not exist in tenant ‘xxx‘ and cannot access the application ‘xxx'(OneDrive SyncEngine) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.

Solution:

Resetting onedrive reset the cached credentials.

To reset the OneDrive desktop sync app in Windows

  1. Open a Run dialog by pressing Windows key  Press the Windows key  and R.
  2. Copy this and paste it into the dialog window, then press OK.
    %localappdata%\Microsoft\OneDrive\onedrive.exe /reset
     If you see a “Windows cannot find…” message, copy and paste this instead, then press OK.
    C:\Program Files\Microsoft OneDrive\onedrive.exe /reset
     If you see a “Windows cannot find…” message, copy and paste this instead, then press OK.
    C:\Program Files (x86)\Microsoft OneDrive\onedrive.exe /reset
  3. Manually restart OneDrive by going to Start  Press the Windows key, type OneDrive in the search box, and then click on the OneDrive desktop app.

Notes: 

  • Resetting OneDrive disconnects all your existing sync connections (including personal OneDrive and OneDrive for work or school if set up). You won’t lose files or data by resetting OneDrive on your computer.
  • If you had chosen to sync only some folders before the reset, you will need to do that again once sync has completed.
  • You will need to complete this for your personal OneDrive and OneDrive for work or school.

To reset the OneDrive store app in Windows

Tip: If you’re not sure which OneDrive app you have, read Which OneDrive app do I have?

  1. Press Start  Press the Windows key  and enter apps:onedrive
  2. Select App settings
  3. Scroll down the list and select Reset.