Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | ODRIVE_E_AUTH_TOKEN_EXPIRED | OneDrive diagnostic log | -> Get-ODStatus |
| Affected build range | Windows 10 / Windows 11 / Microsoft 365 | Microsoft documentation | |
| Registry key involved | HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts | Registry Editor | -> Check for account details |
| Relevant service/endpoint URL | https://login.microsoftonline.com/common/oauth2/v2.0/token | Network traffic capture | |
| Log line signature | AADSTS70008: Refresh token has expired or been revoked | Event Viewer > Applications and Services Logs > Microsoft > OneDrive |
Log Files to Check
C:\Users\<username>\AppData\Local\Microsoft\OneDrive\logs\OneDrive.logC:\Windows\System32\winevt\Logs\Application.evtx
What This Error Actually Means
The error code ODRIVE_E_AUTH_TOKEN_EXPIRED (0x8004def5) is raised by the OneDrive desktop client when it fails to obtain a valid OAuth access token for the signed-in account. The OAuth protocol uses refresh tokens to extend session duration, but these can expire or be revoked under certain conditions. This error specifically indicates that the refresh token has expired, been invalidated due to password reset, multi-factor authentication (MFA) changes, device compliance issues, or Conditional Access policies set in Azure Active Directory (AAD). The client cannot proceed with syncing files until a new access token is obtained through interactive user re-authentication.Affected Versions and Scope
This error affects users running OneDrive on Windows 10, Windows 11, or Microsoft 365. It impacts both personal accounts and business accounts (Office 365/Exchange Online). The issue is prevalent in environments where Conditional Access policies are enforced to ensure device compliance before allowing access to resources such as OneDrive. However, it does not affect users who have persistent tokens configured for long-term authentication or those whose devices do not require re-authentication due to policy exemptions.Where To Look First: Logs and Event IDs
To diagnose the root cause of ODRIVE_E_AUTH_TOKEN_EXPIRED, start by examining the OneDrive diagnostic log located atC:\Users\\AppData\Local\Microsoft\OneDrive\logs\OneDrive.log . Search for the exact error string "ODRIVE_E_AUTH_TOKEN_EXPIRED" to confirm that this is indeed the issue. Additionally, inspect the Event Viewer logs under Applications and Services Logs > Microsoft > OneDrive, looking specifically for event ID 4096 (Event ID: 4096) which corresponds to authentication failures.
Another critical location to check is the Windows Application log in Event Viewer, particularly entries related to AADSTS70008. This error indicates that the refresh token has expired or been revoked and needs re-authentication. You can find these logs at C:\Windows\System32\winevt\Logs\Application.evtx. Use PowerShell cmdlets like Get-WinEvent -LogName "Application" | Where-Object {$_.Id -eq 4096} to filter and retrieve relevant entries.
Root Causes
Password Reset or MFA Changes
When a user resets their password or changes their MFA settings, all OAuth tokens associated with that account are invalidated. This includes refresh tokens used by OneDrive for silent re-authentication. To identify if this is the cause, check the sign-in logs in Azure AD for any recent password reset events.Conditional Access Policy Enforcement
AAD Conditional Access policies may require devices to be compliant before allowing access to resources like OneDrive. If a device becomes non-compliant (e.g., due to missing security updates), the refresh token will expire, leading to ODRIVE_E_AUTH_TOKEN_EXPIRED errors. Usedsregcmd /status to verify if the device is Azure AD joined and compliant.
AAD Sign-in Frequency Policy
If an AAD sign-in frequency policy mandates re-authentication after a short interval, users may encounter this error more frequently. Check the Conditional Access policies in the Intune admin center > Policies > Conditional access to see if such a policy is active.Fix Procedure
- Interactive Authentication: Right-click the OneDrive icon and select "Sign In." Complete the interactive authentication process, which will generate new OAuth tokens.
- Azure AD Join Verification: If Conditional Access policies are blocking access, ensure that the device is Azure AD joined. Run
dsregcmd /statusto check ifAzureAdJoined=YESandDeviceIdis non-empty. - Persistent Token Issues: For persistent token issues, navigate to the Intune admin center > Users > [user] > Sign-in logs. Look for AADSTS70008 errors in the sign-in activity to understand why tokens are being invalidated.
- Force Re-registration: Use the command line to force re-registration of OneDrive by running
OneDrive /reset. Restart OneDrive and complete interactive authentication again.
Be cautious when forcing a device re-registration, as this can disrupt ongoing operations and may require users to manually sign in again.
Error Code Variants
| Code | Description | Distinguishing Features |
|---|---|---|
0x8004def5 (ODRIVE_E_AUTH_TOKEN_EXPIRED) |
OAuth refresh token has expired or been revoked. | Error occurs during silent re-authentication attempts; no interactive sign-in prompt is shown. |
0x8004def6 (ODRIVE_E_AUTH_TOKEN_INVALID) |
The OAuth access token is invalid or has been revoked. | Error occurs when an invalid access token is used, often due to a network issue preventing refresh token redemption. |
Verification
After applying the fix procedure, verify that the error no longer appears in OneDrive logs and Event Viewer. Use PowerShell cmdlets likeGet-WinEvent -LogName "Application" | Where-Object {$_.Id -eq 4096} to ensure there are no more AADSTS70008 errors. Additionally, check the Intune admin center > Users > [user] > Sign-in logs for any recent successful sign-ins indicating that re-authentication was completed successfully.
A quick diagnostic shortcut is to use
Get-ODStatus in PowerShell to view OneDrive sync status and error details without navigating through the GUI.Prevention
To prevent recurrence of ODRIVE_E_AUTH_TOKEN_EXPIRED, ensure that Conditional Access policies are configured correctly for your environment. For instance, you can create exceptions or modify existing policies so they do not block silent re-authentication attempts from compliant devices. Additionally, consider implementing persistent tokens for users who frequently encounter this issue due to regular password resets or MFA changes. To enforce device compliance and prevent token expiration issues, use Intune admin center > Devices > Compliance Policies to set up required security configurations and regularly monitor compliance status throughGet-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'".