OneDrive for Business 0x8004de40 sign-in error troubleshooting for VPN users: appears after password reset
🔍 WiseChecker

OneDrive for Business 0x8004de40 sign-in error troubleshooting for VPN users: appears after password reset

When you reset your Microsoft 365 password and connect through a VPN, OneDrive for Business may show error 0x8004de40 at sign-in. This error means OneDrive cannot reach the authentication servers or refresh your cached credentials. The VPN can interfere with the token renewal process that a password reset triggers. This article explains why the error occurs specifically on VPN connections and provides step-by-step fixes to restore sync.

Key Takeaways: Fixing OneDrive Error 0x8004de40 After Password Reset on VPN

  • Windows Credential Manager > Windows Credentials > OneDrive Cached Credentials: Remove stale tokens that prevent re-authentication after a password change.
  • OneDrive Settings > Account > Unlink this PC: Forces a fresh sign-in flow that re-establishes trust with the authentication servers.
  • VPN Client DNS Settings > Use Default Gateway on Remote Network: Disabling this option prevents DNS conflicts that block OneDrive authentication endpoints.

ADVERTISEMENT

Why Error 0x8004de40 Appears After a Password Reset on VPN

Error 0x8004de40 is a sign-in failure code that indicates OneDrive cannot complete the authentication handshake with the Microsoft identity platform. After a password reset, the previously cached token becomes invalid. OneDrive must request a new token using the updated credentials.

When you are connected through a VPN, the network path to the authentication servers may be altered. Some VPN configurations route authentication traffic through a proxy or block certain endpoints. Additionally, the VPN client may cache old DNS records, so OneDrive tries to reach an outdated server IP. The combination of an invalid token and a restricted network path produces the 0x8004de40 error.

The error typically appears immediately after you enter the new password in the OneDrive sign-in window. The sync client displays a red circle with a white X and the error code in the notification area. Sync stops completely until the issue is resolved.

Step-by-Step Fixes for Error 0x8004de40 on VPN

Perform these steps in the order listed. Test sign-in after each step before moving to the next.

Step 1: Clear Stored Credentials in Windows Credential Manager

  1. Open Credential Manager
    Press Windows + R, type control /name Microsoft.CredentialManager, and press Enter.
  2. Select Windows Credentials
    Click the Windows Credentials tab.
  3. Locate OneDrive entries
    Scroll to the Generic Credentials section. Look for entries that contain “OneDrive Cached Credential” or “MicrosoftOffice16_Data:ADAL:”.
  4. Remove each entry
    Click the arrow to expand the entry, then click Remove. Confirm the deletion. Repeat for all OneDrive-related entries.
  5. Restart OneDrive
    Right-click the OneDrive icon in the system tray and select Quit. Open OneDrive from the Start menu to trigger a new sign-in prompt.

Step 2: Unlink and Re-link Your OneDrive Account

  1. Open OneDrive Settings
    Right-click the OneDrive cloud icon in the notification area and select Settings.
  2. Go to the Account tab
    Click the Account tab at the top of the window.
  3. Click Unlink this PC
    Click the Unlink this PC link. A confirmation dialog appears. Click Unlink account.
  4. Sign in again
    After unlinking, the OneDrive setup window opens. Enter your work or school email address. Click Sign in. Enter your new password when prompted.
  5. Complete the setup
    Follow the prompts to choose your sync folder location and settings. Sync resumes with the new token.

Step 3: Adjust VPN DNS and Proxy Settings

  1. Open VPN adapter properties
    Go to Settings > Network & Internet > VPN. Select your VPN connection and click Advanced options.
  2. Disable DNS over VPN
    Look for a setting named “Use default gateway on remote network” or “Send all traffic over VPN.” Set this to Off. This prevents the VPN from overriding your local DNS servers.
  3. Clear DNS cache
    Open Command Prompt as administrator and run ipconfig /flushdns.
  4. Disable VPN proxy if enabled
    In the same VPN settings page, check if a proxy server is configured under Proxy settings. Set it to Automatically detect settings or turn it off.
  5. Reconnect the VPN
    Disconnect and reconnect the VPN. Test OneDrive sign-in again.

Step 4: Reset OneDrive Sync Client

  1. Close OneDrive completely
    Right-click the OneDrive icon in the system tray and select Quit.
  2. Open Run dialog
    Press Windows + R.
  3. Run the reset command
    Type %localappdata%\Microsoft\OneDrive\onedrive.exe /reset and press Enter.
  4. Wait for OneDrive to restart
    A command window flashes briefly. OneDrive restarts automatically after a few seconds. If it does not, run %localappdata%\Microsoft\OneDrive\onedrive.exe from the Run dialog.
  5. Sign in again
    Enter your email address and new password. Sync resumes.

ADVERTISEMENT

If OneDrive Still Shows Error 0x8004de40 After the Main Fix

OneDrive error 0x8004de40 persists after unlinking and clearing credentials

If the error remains, the VPN may be blocking the specific authentication URLs that OneDrive uses. Add the following endpoints to your VPN client’s split-tunnel exception list or work with your VPN provider to allow them:

  • login.microsoftonline.com and all subdomains
  • login.windows.net
  • graph.microsoft.com
  • sharepoint.com and all subdomains

Contact your IT administrator to confirm that these URLs are not blocked by the corporate firewall or VPN policy.

Error 0x8004de40 appears only on certain Wi-Fi networks but not on others

This indicates a network-level issue rather than a credential problem. The Wi-Fi network may use a captive portal or proxy that interferes with OneDrive authentication. Connect to a different network, such as a mobile hotspot, and test sign-in. If sign-in succeeds, configure the problematic network’s DNS to use a public resolver like 8.8.8.8 or 1.1.1.1.

OneDrive sync works after signing in but fails after a few minutes

This pattern suggests that the VPN connection drops or changes IP address during a sync session. Check your VPN client settings for a feature called “persistent tunnel” or “keep-alive.” Enable it to maintain a stable connection. Also, update your VPN client software to the latest version.

OneDrive Sign-in Methods: Direct vs VPN Connection

Item Direct Connection VPN Connection
Authentication endpoint reachability Direct DNS resolution to login.microsoftonline.com May be routed through VPN DNS or proxy, causing timeouts
Token renewal after password reset New token obtained in seconds with no network interference Token renewal may fail if VPN blocks ADAL traffic
Credential cache behavior Stored in Windows Credential Manager, refreshed automatically Stale cache may persist if VPN disconnects mid-refresh
Error 0x8004de40 likelihood Rare, usually caused by corrupted local cache Common after password reset due to DNS or proxy interference

The table shows that VPN connections introduce additional failure points. The same credential and token issues that rarely cause problems on a direct connection can trigger error 0x8004de40 when the VPN is active.

After completing the steps in this article, you can sign in to OneDrive successfully even when connected through a VPN. If the error recurs after another password reset, repeat the credential clearing and unlinking steps. For persistent VPN-related issues, configure split tunneling to let authentication traffic bypass the VPN tunnel entirely.

ADVERTISEMENT