OneDrive sign-in error 0x8004de40 is a connectivity issue between your device and Microsoft's servers.

The Fix

Follow these steps in order. Test OneDrive sign-in after each step before proceeding to the next.

First, verify your network connection. Confirm other websites work in your browser. If you use a VPN or proxy, disable it temporarily. For Wi-Fi, try forgetting the network and reconnecting, or test with an alternate connection like a mobile hotspot.

If that doesn't work, enable TLS protocols.

1. Press Windows + R, type inetcpl.cpl, and press Enter.

2. Navigate to the Advanced tab.

3. Under Security, ensure the boxes for "Use TLS 1.0", "Use TLS 1.1", and "Use TLS 1.2" are checked.

4. Click Apply, then OK.

5. Restart your computer and attempt to sign in again.

If that doesn't work, reset the OneDrive application. Run one of these commands in an elevated Command Prompt or the Run dialog (Windows + R). The correct path depends on your installation.

"%localappdata%\Microsoft\OneDrive\onedrive.exe" /reset

If the file isn't found, try:

"C:\Program Files\Microsoft OneDrive\onedrive.exe" /reset

Or:

"C:\Program Files (x86)\Microsoft OneDrive\onedrive.exe" /reset

Wait a minute, then restart your PC. OneDrive will relaunch automatically.

If that doesn't work, rejoin Azure Active Directory. Open an elevated Command Prompt and run:

dsregcmd /leave

Then run:

dsregcmd /join

Restart your computer and try signing in.

If that doesn't work, check security software. Temporarily disable third-party firewall or antivirus software. If this allows a successful sign-in, add exceptions for OneDrive in your security software.

If that doesn't work, clear the OneDrive cache. Close OneDrive via Task Manager, then navigate to %localappdata%\Microsoft\OneDrive in File Explorer. Delete the contents of the settings folder (consider a backup first), then relaunch OneDrive.

If that doesn't work, reinstall OneDrive. Uninstall it via Settings > Apps > Installed apps. Download and install the latest version from the official Microsoft website.

Verify

A successful fix is confirmed when you can sign into the OneDrive desktop app without error 0x8004de40. Your files should begin syncing normally. For persistent issues in enterprise environments, check network proxy configurations and ensure group policies are not disabling required TLS protocols.