EdbMails EDB Recovery and Migration software
  • Products
    EdbMails
    All-in-one Recovery and Migration Tool
    • EDB recovery and Migration
    • OST, PST, MBOX, NSF, EML, MSG
    • Office 365, Exchange Migration
    • SharePoint, OneDrive & Teams
    • G Suite Migration
    • IMAP Migration
    • Duplicate Remover
    • EdbMails Data Recovery
    • Backup Solutions
    All Products

    EDB Recovery and Migration

    EdbMails lets you recover corrupted, damaged, and offline Exchange EDB files, convert EDB mailboxes to PST format, and directly migrate mailbox data to Office 365 and live Exchange Server.

    EDB to PST
    Recover corrupted, damaged, offline EDB files and convert Exchange EDB mailboxes to PST file format
    Public Folder to Exchange
    Migrate public folders from an Exchange offline EDB file to live Exchange Server
    EDB to Live Exchange Migration
    Directly migrate offline Exchange database (EDB) files to live Exchange server
    Archive Mailbox to Office 365
    Migrate archive mailboxes from offline EDB files directly to Office 365
    EDB to Office 365 Migration
    Directly migrate offline Exchange database (EDB) files to Office 365
    Public Folder to Office 365
    Migrate public folders from an offline Exchange EDB file to Office 365

    OST, PST, MBOX, NSF, EML, MSG Export and Migration

    EdbMails lets you to recover OST and PST files, export OST, PST, MBOX, NSF, EML, and MSG files to PST files, and directly migrate OST, PST, MBOX, and NSF mailbox data to Office 365 and live Exchange Server.

    OST Recovery and Migration
    Recover offline OST files, convert OST to PST, and migrate OST to Office 365 and Exchange Server
    PST Recovery and Migration
    Recover Outlook PST files , Export PST to PST, migrate PST to Office 365 and Exchange Server
    MBOX Export and Migration
    Export MBOX to PST, migrate MBOX to Office 365 and Exchange Server
    NSF Export and Migration
    Export NSF to PST, migrate NSF to Office 365 and Exchange Server
    EML to PST Export
    Convert EML files to Outlook PST files
    PST to MSG Export
    Convert Outlook PST file to MSG file format
    MSG to PST Export
    Export MSG files to Outlook PST files

    Office 365, Exchange Migration

    EdbMails lets you securely migrate mailboxes across Microsoft 365, Exchange, Google Workspace (G Suite), and IMAP-supported servers such as Outlook, Gmail, Zimbra, Zoho Mail, and cPanel, ensuring zero downtime.

    Office 365 Migration
    Migrate between Office 365 tenants, Office 365 to Exchange, Office 365 to PST, PST files to Office 365.
    Exchange Migration
    Migrate between any Exchange Servers, Exchange to Office 365, Exchange to PST, PST files to Exchange.
    Tenant to Tenant Migration
    Migrate Mailboxes, Public Folders, Archive Mailboxes between Office 365 Tenants.
    Exchange to Office 365
    Migrate Mailboxes, Public Folders, Archive Mailboxes from live Exchange server to Office 365.
    Office 365 to IMAP
    Migrate Office 365 to IMAP, Office 365 to Gmail, Office 365 to Outlook, Office 365 to Zoho etc.
    Exchange to IMAP
    Migrate from live Exchange Server to IMAP servers such as Gmail, Outlook, and Zoho Mail.
    Public Folder to Office 365
    Migrate Public Folders between Office 365 tenants with complete folder hierarchy and mailbox data integrity.
    Exchange to PST
    Export live Exchange Server mailboxes, public folders, and archive mailboxes to Outlook PST files.

    SharePoint, OneDrive & Microsoft Teams Migration

    EdbMails lets you migrate SharePoint sites, OneDrive data, Microsoft Teams, teams, channels, chats, permissions, and documents between Microsoft 365 tenants while maintaining the existing folder structure and data integrity.

    SharePoint Online Migration
    Migrate documents, lists, files and folders from SharePoint sites.
    OneDrive for Business Migration
    Migrate documents, lists, files, folders, private chats from OneDrive.
    Microsoft Teams Migration
    Migrate Teams, chats, channels, documents, files and folders etc.

    Google Workspace / G Suite Migration

    EdbMails G Suite Migration Tool lets you easily migrate emails, calendars, contacts, tasks, and more from G Suite to Office 365, Exchange Server, and IMAP servers using a Google Admin account without requiring individual user credentials.

    G Suite Migration
    Migrate emails, calendars, contacts, tasks from G Suite to Office 365, G Suite to Exchange, G Suite to IMAP Servers
    G Suite to Office 365
    Migrate emails, calendars, contacts, tasks from Google Workspace / G Suite to Office 365
    G Suite to Exchange Server
    Migrate emails, calendars, contacts, tasks from Google Workspace / G Suite to on-Premise Exchange Server
    G Suite to IMAP
    Migrate emails, calendars, contacts, tasks from Google Workspace / G Suite to IMAP, Outlook, Zimbra, Zoho etc.

    IMAP Migration

    EdbMails IMAP Migration tool lets you easily migrate emails from IMAP servers such as Outlook, Gmail, Zoho Mail, Zimbra, cPanel, and more. Supports IMAP to IMAP, Office 365, Exchange Server, PST, and bulk PST to IMAP migration.

    IMAP Email Backup & Migration
    Backup and migrate emails from IMAP servers to PST, Office 365, and On-Premises Exchange Server
    IMAP to Office 365
    Migrate emails, folders, and attachments from IMAP servers to Office 365
    IMAP to Exchange
    Migrate emails, folders, and attachments from IMAP servers to on-premises Exchange Server
    IMAP to PST
    Export emails, folders, and attachments from IMAP servers to Outlook PST files for backup
    PST to IMAP
    Migrate emails, folders, and attachments from bulk PST files to IMAP servers

    Duplicate Remover

    EdbMails Duplicate Remover lets you easily remove duplicate items from Office 365 and Exchange Server, and from IMAP, Outlook, Gmail, Zimbra, Zoho Mail, etc., ensuring a clean and organized mailbox.

    Remove Duplicates
    Easily clean up your Office 365, Exchange, Outlook and IMAP accounts by removing duplicate emails.
    Remove Duplicates from Office 365
    Remove duplicate emails, calendars, contacts, journal tasks, etc. from Office 365.
    Remove Duplicates from Exchange Server
    Remove duplicate emails, calendars, contacts, journal tasks, etc. from live Exchange Server.
    Remove Duplicates from IMAP, Outlook
    Remove duplicate emails, attachments from IMAP, Outlook, Gmail, Zimbra, Zoho Mail etc.

    Exchange, SharePoint, OneDrive, Teams and Office 365 Backup

    EdbMails enables secure, automated backup and recovery for Microsoft 365 services including Exchange Online, SharePoint, OneDrive, Teams, and Live Exchange Server with complete data protection and restore flexibility.

    Office 365 Backup
    Incremental, Granular, Encrypted and Compressed Office 365 Mailboxes Backup
    Exchange Server Backup
    Incremental, Granular, Encrypted and Compressed Exchange Mailboxes Backup
    SharePoint, OneDrive & Teams Backup
    Backup Online site collections, Team sites, Office 365 groups, all documents etc.

    EdbMails Data Recovery

    EdbMails Data Recovery Software lets you recover permanently deleted data, including photos, videos, documents, and archived files, from partitions on hard drives, SSDs, USB drives, SD cards, and external storage devices.

    EdbMails Data Recovery
    Recover and restore permanently deleted data from hard drives, SSDs, USB drives, SD cards, and etc.
    Whitepaper
    Request a Demo
    Sign Up
  • Features
  • FAQ
  • Offers
  • Pricing
  • Download
  • Support
  • Sign in
User’s Manual
Office 365 Migration

User Manual

User Manual

  • Office 365 Migration Overview
  • Initial setup
  • System Requirements
  • Migration Scenarios
  • Software Setup
    • EdbMails Installation Process
    • Upgrading the Software
    • How to uninstall
    • Reinstallation
  • Understanding the Application
    • Software's Main Components
    • Understanding the Migration
  • FAQ
    • General
    • Migration Free Trial / Demo
    • Migration License
    • Before Migration
    • Migration - Steps
    • After Migration
  • Videos
    • Office 365 to Office 365
    • Office 365 to Exchange
    • Office 365 to IMAP
    • Office 365 to PST
    • Public Folder to Office 365
    • Archive Mailbox to Office 365
    • Public Folder to Exchange
    • Archive Mailbox to Exchange
    • Restore Bulk PST files to Office 365
    • Automatically Create Office 365
    • Export Office 365 user to CSV file
  • Screenshots
    • Office 365 to Office 365
    • Office 365 to Exchange
    • Office 365 to PST
    • Office 365 to IMAP
  • How it works?
    • Office 365 to Office 365
    • Office 365 to Exchange
    • Office 365 to IMAP
    • Office 365 to PST
    • Public Folder to Office 365
    • Public Folder to Exchange
    • Public Folder to Shared Mailbox
    • Archive Mailbox to Office 365
    • Archive Mailbox to Exchange
    • Office 365 to Hosted Exchange
    • Multiple PST to Office 365
    • Office 365 to Gmail Migration
    • Office 365 Shared mailbox to Exchange
    • Office 365 Public folders to PST
    • Office 365 archive mailbox to PST
    • Office 365 Shared mailbox to PST
    • Office 365 shared mailbox to Public folder
    • Office 365 Archive mailbox to Shared mailbox
    • Office 365 Shared mailbox to Archive mailbox
    • Office 365 to Zoho migration
    • Office 365 group mailbox to shared mailbox
    • Shared mailbox to Office 365 Groups mailbox
    • Office 365 Groups mailbox to Regular mailbox
  • Connect to source Office 365
  • Connect to target Office 365
  • Modern Authentication Using OAuth 2.0
    • Microsoft 365 modern authentication
    • Automatic Registration
    • Manual Registration
  • Connect to Exchange server
  • Knowledge Base
    • Migrate between Office 365 tenants
    • Migrate Office 365 mailbox
    • Public folder migration
    • Office 365 to Exchange Migration
    • Office 365 Migration with same Domain
    • Office 365 Group Migration
    • Selective Mailbox Migration
    • Migration to Exchange 2007, 2010, 2013, 2016 and 2019
    • User-Defined Mailbox/Folder Mapping
    • Export Office 365 users to CSV
    • GoDaddy to Microsoft 365 migration
    • Rackspace to Office 365 migration
    • Office 365 migration methods
    • Office 365 migration checklist
    • Migrate Shared mailbox to Office 365
    • Office 365 migration best practices
    • Office 365 migration challenges
    • Convert shared mailbox to regular mailbox
    • Office 365 to Exchange 2019 migration
    • Office 365 multiple mailbox migration
    • Office 365 Server to Server Migration
    • Cross-Tenant Office 365 migration
    • EWS throttling in Exchange Online
    • Office 365 migration common use cases and solutions
    • Language settings on Office 365 Server
    • Office 365 to iCloud migration
    • Office 365 to Yahoo Mail migration
    • Microsoft 365 sign-in issue
    • Batch create Outlook profiles Intune
    • Create an Office 365 Migration Endpoint
    • Validate Office 365 Mailbox Migration
    • Office 365 Migration Network Requirements
    • Microsoft 365 Migration URLs & Endpoints
    • Office 365 Migration Firewall Ports
    • DNS Changes After Office 365 Migration
    • Autodiscover Troubleshooting After Migration
    • Post-Migration MX Record Validation
    • Office 365 Mail Flow Troubleshooting
    • Mailbox Permission Validation
    • EdbMails vs CodeTwo vs MigrationWiz vs Native Tools
    • Calendar Permission Migration Issues
    • Folder Permission Troubleshooting
    • Large Mailbox Migration Best Practices
    • Archive Mailbox Sync Issues
    • Office 365 Migration Coexistence
    • Cross-Tenant Mailbox Permissions
    • Cross-Tenant Calendar Migration
    • Migration Using App-Only Authentication
    • Office 365 Mailbox Mapping Errors
    • Exchange Online Migration Limits
    • Mailbox Integrity After Migration
    • Security Best Practices for Migration
  • Migration Types
    • Cutover Migration
    • Staged Migration
  • Set Exchange Server Impersonation rights
  • Map the Mailboxes
  • Migration Walkthrough
    • Office 365 tenant to tenant migration
    • Office 365 to Exchange migration
    • Office 365 to PST Export
  • Multifactor Authentication
    • Enable MFA in Office 365
    • Create App password for MFA
    • Disable Security Defaults
  1. Home
  2. Office 365 Migration
  3. Resolve OAuth Token Errors During Office 365 Migration
Download Buy Now

Resolve OAuth Token Errors During Office 365 Migration

There's a specific kind of headache that comes from a migration job dying overnight with nothing but an invalid_grant error and a cryptic AADSTS code in the log. No password changed. No setting was touched. The job just stopped trusting itself. This is one of the more confusing categories of migration failure precisely because it has nothing to do with the data being moved — it's about the access token that was supposed to be quietly renewing itself in the background, and didn't. OAuth tokens are the backbone of how modern Microsoft 365 connections stay authenticated without repeatedly prompting for a password, but they come with their own lifecycle rules, and a migration that runs longer than expected can easily outlast the token that started it. EdbMails Office 365 Migration is built to manage this token lifecycle automatically, refreshing access tokens behind the scenes so a long-running migration doesn't quietly stall because a token expired three hours into an overnight batch. This page breaks down why OAuth token errors happen, what the common error codes actually mean, and how to deal with them when they show up.

A Quick Refresher: Access Tokens vs. Refresh Tokens

It helps to separate the two pieces that make OAuth work, because most token errors point squarely at one or the other:

  • An access token is short-lived — typically valid for around an hour — and is what's actually presented to Microsoft 365 services to prove a request is authorized.
  • A refresh token lives much longer and is used quietly behind the scenes to get a new access token once the old one expires, without requiring the user to sign in again.

A migration tool that's been authenticated once should, in theory, keep refreshing its access token using the refresh token indefinitely. The trouble starts when the refresh token itself becomes invalid — at that point, there's nothing left to refresh from, and the whole authentication chain collapses until someone re-authenticates from scratch.

Why OAuth Tokens Fail Mid-Migration

Refresh Token Inactivity Expiry (AADSTS700082 / AADSTS70008)

This is probably the single most common token error reported across Microsoft 365 integrations, not just migration tools. Microsoft's identity platform expires a refresh token if it sits unused for an extended period — commonly around 90 days, though the exact window depends on tenant policy. For most active, daily migration jobs this rarely bites, but it shows up often in paused projects: a migration started, set aside for a few months, and then resumed, only to find the previously-working connection now needs a fresh round of consent.

"Remember MFA" Settings Interfering with Token Refresh

A less obvious cause of the same AADSTS700082 error: when a tenant has a "remember MFA for X days" policy enabled, it can interact poorly with the underlying refresh token lifecycle, effectively invalidating the token even though the integration appeared to be working normally up to that point. Disabling that setting and allowing roughly half an hour for the change to propagate is the usual fix.

Revoked Tokens After a Password Reset or Security Event (AADSTS50173)

If the account a migration is authenticated as has its password changed, gets flagged for a security event, or has its sessions revoked by an admin, Microsoft invalidates the existing refresh tokens as a security measure. The migration then fails with an invalid_grant error, and the only real fix is re-authenticating the connection from scratch.

Conditional Access or MFA Re-Challenge (AADSTS50076 / AADSTS50158)

Some tenants have Conditional Access policies that require interactive sign-in under certain conditions — a new location, a new device fingerprint, a policy change. When that happens mid-migration, the existing token silently stops being sufficient, and the connection needs a fresh interactive consent before it'll work again.

Fixed-Lifetime Tokens for Certain App Types (AADSTS700084)

Tokens issued to certain application types — particularly single-page applications — have a hard, non-extendable lifetime rather than a sliding inactivity window. Once that fixed window closes, there's no keeping it alive through activity; a new interactive sign-in is required. This is less common for traditional migration tooling but worth knowing if a custom script or connector is involved.

Missing or Withdrawn Admin Consent

OAuth app registrations typically need a tenant admin to consent to the permissions being requested. If that consent is later revoked — deliberately, or as a side effect of a broader security review — token requests start failing even though the app registration itself hasn't changed.

How These Errors Typically Show Up in Logs

  • "error": "invalid_grant", "error_description": "AADSTS700082: The refresh token has expired due to inactivity."
  • A migration batch that was progressing normally suddenly stops, with no new data moved despite the job showing as "in progress"
  • Repeated re-authentication prompts appearing for an account that previously connected without issue
  • A token-related failure that affects every mailbox in a batch simultaneously, rather than just one or two — a strong signal it's a connection-level token issue rather than a mailbox-specific problem

How Different Migration Tools Handle Token Lifecycle

ApproachToken HandlingCommon Pain Point
Manual scripts using a one-time OAuth flowAccess and refresh tokens captured once and reused as-isNo built-in renewal logic; once the refresh token expires or is revoked, the script simply fails with no automatic recovery
Tools relying on a single long-lived session per migration projectRefresh token used throughout the project but not actively monitoredWorks fine for short projects; long-running or paused-and-resumed migrations risk hitting inactivity expiry or tenant policy changes mid-project
Tools with manual re-authentication prompts on failureDetects token failure and prompts the administrator to reconnectFunctional, but requires someone to notice and respond to the prompt, which can stall overnight or unattended batches
Tools with automatic, proactive token renewalRefreshes access tokens before they expire and handles standard renewal failures without manual interventionReduces unattended failures significantly, though tenant-side events like a password reset or revoked consent still require a fresh authentication regardless of the tool

The differentiator across these isn't whether OAuth is used — virtually everything modern uses OAuth at this point — it's whether the tool actively manages the token lifecycle or just assumes the original token will keep working indefinitely.

How EdbMails Handles OAuth Token Management

EdbMails Office 365 Migration Tool is designed to manage the OAuth token lifecycle automatically rather than leaving it to chance over a long-running migration:

  • Automatic access token renewal, refreshing tokens in the background before they expire, so a migration running for several hours or overnight doesn't stall partway through over a routine token refresh.
  • Clear error reporting when a token issue does occur, distinguishing a renewable token problem from one that genuinely requires fresh administrator consent — so you're not left guessing whether the fix is a quick retry or a full re-authentication.
  • Resilience to interruption, since EdbMails' incremental/delta migration model means that if a batch does need to pause for re-authentication, previously migrated data isn't duplicated once the connection is restored.
  • Modern OAuth-based connections by design, avoiding the kind of one-time, unmonitored token capture that tends to be the root cause of unattended token failures in simpler scripts and tools.

This doesn't mean tenant-side events are avoidable — if an administrator resets a password, revokes consent, or a Conditional Access policy forces an interactive challenge, re-authentication is still required regardless of which migration tool is involved. What it does mean is that the routine, predictable side of token expiry isn't something administrators need to babysit manually.

Step-by-Step: Resolving an OAuth Token Error

  1. Capture the exact AADSTS code from the error message — it almost always tells you precisely which category of token failure you're dealing with.
  2. Check whether the issue is inactivity-related (AADSTS700082/70008). If the connection has been idle for an extended period, the fix is usually as simple as re-consenting through the OAuth flow again.
  3. Check tenant-level MFA and Conditional Access settings. A "remember MFA for X days" policy or a recent Conditional Access change can silently invalidate tokens that otherwise look fine.
  4. Confirm nothing changed on the authenticating account — a password reset, account compromise response, or admin-initiated session revocation will always require fresh authentication, no exceptions.
  5. Verify admin consent is still active for the app registration in question, particularly if a tenant-wide security review or app governance policy has run recently.
  6. Re-authenticate and test against a single mailbox before resuming a full batch, to confirm the new token is actually working end-to-end.
  7. Resume rather than restart the migration batch where possible, so mailboxes already completed aren't re-processed unnecessarily.

Best Practices to Avoid Token Errors During Migration

  • For long or paused-and-resumed migration projects, avoid letting a connection sit completely idle for months at a time without at least a connectivity check
  • Review tenant MFA "remember for X days" settings before a major migration, since they've been linked to unexpected token invalidation
  • Communicate any planned password resets or security reviews to the migration team in advance, since these will force re-authentication regardless of timing
  • Keep admin consent and app registration permissions documented, so a missing-consent issue can be diagnosed quickly rather than re-investigated from scratch
  • Where possible, run migrations in well-defined batches rather than one continuous multi-week job, so a token-related pause affects a smaller, easier-to-resume slice of the project

Frequently Asked Questions

  1. What does AADSTS700082 mean, and is it serious?

    It means the refresh token tied to a connection has expired, almost always due to extended inactivity (commonly around 90 days). It's not a data-loss issue — it just means the connection needs to be re-authenticated through the OAuth consent flow again before the migration can continue.

  2. Why did my migration token expire even though I was actively using it?

    This is most often linked to a tenant setting like "remember MFA for X days," which can invalidate the underlying refresh token despite apparent ongoing use. Disabling that setting and allowing some time for the change to take effect usually resolves it.

  3. Can a token error cause data loss or corruption during migration?

    No. A token error blocks the connection from authenticating further requests — it doesn't corrupt or delete data already migrated. The main risk is simply lost time until the connection is re-authenticated.

  4. Does EdbMails handle OAuth token renewal automatically?

    Yes. EdbMails refreshes access tokens in the background during a migration, which avoids the common scenario of a long-running or overnight batch stalling because of a routine token expiry. Tenant-side events like a password reset or revoked consent will still require manual re-authentication, since no migration tool can bypass that.


Additional resources:

  • EdbMails Office 365 Migration Software
  • Resolve Office 365 Migration Endpoint Authentication Errors
  • Resolve Office 365 Mailbox Mapping Errors
  • Exchange Online Service Limits for Migration
  • Coexistence During Office 365 Migration
  • Automatic registration of EdbMails in Azure AD
  • Manual Registration of EdbMails in Azure AD
lady image

 

 In this manual

IntroductionWhy OAuth Tokens FailToken Lifecycle HandlingToken ManagementResolving OAuth ErrorBest PracticesFAQ's

Office 365 Migration

100 Mailboxes $299 Only

Buy Now

Need help?

24/7 Customer support

Contact us on Live chat

Personalized Demo

Book a personalized demo

Still need help?

Email us / Call us

© 2026 Shifttocloud Inc. Privacy Policy | Terms of Use | GDPR | Security | Press Releases

hidden msg
Live Chat

Hi, May I help you?

Hide Chat Now