The 0x8004de40 sign-in error in OneDrive for Business prevents remote workers from accessing their files. This error often reappears after a restart or network change. The root cause is a corrupted or missing authentication token that OneDrive uses to verify your identity with Microsoft 365. This guide explains why the error occurs and provides step-by-step fixes to resolve it permanently.
Remote workers frequently encounter the 0x8004de40 error because their network conditions change often. VPN disconnections, Wi-Fi switches, or proxy settings can invalidate the cached token. Instead of requesting a new token, OneDrive shows the error and blocks sign-in.
This article covers the technical cause of the 0x8004de40 error, three methods to fix it, and related failure patterns that appear with this error code.
Key Takeaways: Fixing the 0x8004de40 OneDrive Sign-In Error
- OneDrive Settings > Account > Unlink this PC: Removes the corrupted token and forces a fresh authentication request.
- Credential Manager > Windows Credentials > Generic Credentials: Delete all entries containing “OneDrive” or “MicrosoftOffice” to clear stale tokens.
- Run:
onedrive.exe /resetin Command Prompt: Resets the OneDrive sync engine without unlinking the account.
Why the 0x8004de40 Error Persists for Remote Workers
The 0x8004de40 error is an authentication failure code returned by the Microsoft identity platform. When OneDrive tries to sign in, it sends a cached token to Azure Active Directory. If that token is expired, malformed, or tied to a different network session, Azure AD rejects it and returns error 0x8004de40.
For remote workers, the token becomes invalid more frequently because of several factors:
- VPN reconnections change the IP address and session context, causing Azure AD to treat the request as suspicious.
- Network switches between Wi-Fi and mobile hotspot alter the device’s network profile.
- Proxy or firewall settings block the token refresh endpoint
login.microsoftonline.com. - Corrupted Credential Manager entries from a previous sign-in keep feeding the wrong token to OneDrive.
The error keeps returning because the underlying token issue is not resolved by a simple restart. OneDrive reuses the same corrupted token until you force it to discard the cached credentials.
Steps to Fix the 0x8004de40 Sign-In Error
Follow these methods in order. Each method addresses a different layer of the token problem. Test sign-in after each method before moving to the next.
Method 1: Unlink and Relink OneDrive
Unlinking OneDrive removes the cached token and forces a new authentication request.
- Open OneDrive Settings
Right-click the OneDrive cloud icon in the system tray and select Settings. If the icon is missing, search for “OneDrive” in the Start menu and open it. - Go to the Account tab
In the settings window, select the Account tab at the top. - Unlink this PC
Under “Your account,” click Unlink this PC. Confirm the prompt that warns you about losing sync connections. - Restart and sign in again
Restart the computer. After reboot, open OneDrive and sign in with your work or school account. Enter your credentials and complete multi-factor authentication if required.
Method 2: Clear Stale Credentials from Credential Manager
If unlinking does not work, the token may be stored in Windows Credential Manager. Deleting those entries forces a fresh token request.
- Open Credential Manager
Press Windows + R, typecontrol /name Microsoft.CredentialManager, and press Enter. - Select Windows Credentials
In Credential Manager, click Windows Credentials. - Delete OneDrive and Microsoft Office entries
Scroll to the “Generic Credentials” section. Look for entries that start with “OneDrive” or “MicrosoftOffice.” Click the arrow to expand each entry, then click Remove. Confirm the deletion. - Restart OneDrive
Close OneDrive from the system tray. Restart it from the Start menu. Sign in again.
Method 3: Reset OneDrive Sync Engine
The /reset command reinitializes the sync engine without unlinking your account. This fixes corrupted configuration files.
- Close OneDrive completely
Right-click the OneDrive cloud icon in the system tray and select Close OneDrive. Confirm that the icon disappears. - Open Command Prompt
Press Windows + R, typecmd, and press Enter. Do not run as administrator. - Run the reset command
Typeonedrive.exe /resetand press Enter. A black window flashes briefly. Wait 30 seconds. - Restart OneDrive manually
Press Windows + R, typeonedrive.exe, and press Enter. OneDrive reopens and prompts you to sign in.
If OneDrive Still Shows Error 0x8004de40 After the Main Fix
Some remote workers have persistent issues even after unlinking and clearing credentials. The following scenarios explain why and how to resolve them.
OneDrive fails to sign in after a VPN reconnect
When the VPN reconnects, the network adapter changes. OneDrive may still hold a token tied to the previous adapter. Disconnect the VPN, unlink OneDrive, reconnect the VPN, and link OneDrive again. This forces the token to match the active VPN session.
Error appears only on company-managed devices with conditional access policies
Your IT administrator may require a compliant device or a specific network location. If your device does not meet the policy, Azure AD blocks the token and returns 0x8004de40. Contact your IT help desk to verify device compliance or request an exception for remote work.
OneDrive shows the error after a Windows update
A Windows update can reset network settings or change the authentication broker. Run the onedrive.exe /reset command as described in Method 3. If the error persists, reinstall OneDrive by downloading the latest version from the Microsoft 365 admin center.
| Item | Unlink and Relink | Clear Credential Manager | Reset Sync Engine |
|---|---|---|---|
| Scope | Removes all cached tokens and sync connections | Deletes stored credentials for OneDrive and Office | Resets sync configuration without unlinking |
| Data loss risk | None for local files; sync status is lost | None | None |
| Time required | 5 minutes plus initial sync | 3 minutes | 2 minutes |
| Best for | First attempt and persistent errors | When unlinking does not help | Post-update or config corruption |
After resolving the 0x8004de40 error, verify that sync works by opening a file from the OneDrive folder. If you still see sync pauses, check the network firewall rules to ensure login.microsoftonline.com and onedrive.live.com are allowed. For remote workers, using a persistent VPN connection reduces the chance of token invalidation.