How to Resolve Microsoft Account Sign-in Loops on Windows

Difficulty
Intermediate
Tested on
Windows 11 Build 22631
You will need
Administrator access, Stable internet connection

Step by step

  1. 1 min

    Check system time synchronization

    Incorrect system clocks prevent security tokens from validating. Right-click the clock in the Taskbar and select Adjust date and time. Ensure Set time automatically is toggled On and click Sync now.

    Note: If the time is off by more than a minute, authentication tokens will consistently fail.
  2. 2 min

    Clear identity credentials

    Open the Start menu and type Credential Manager. Select Windows Credentials. Locate all entries beginning with MicrosoftAccount, click the entry, and select Remove. Confirm the deletion for every entry found.

  3. 1 min

    Repair system files

    Press Win + X and select Terminal (Admin). Type sfc /scannow and press Enter. Once complete, run dism /online /cleanup-image /restorehealth to repair the underlying system image components.

    Note: Wait for the process to reach 100% before closing the terminal window.
  4. 1 min

    Reset network stack

    In the same Admin Terminal, type ipconfig /flushdns and press Enter. Follow this by typing netsh winsock reset. These commands clear corrupted local network caches that frequently interfere with Microsoft identity servers.

    Note: A system restart is required for these network changes to take full effect.
  5. 2 min

    Perform a clean re-login

    Navigate to Settings > Accounts > Your info. Select Sign in with a local account instead if the loop prevents standard usage, complete the local migration, and restart the device. Upon reboot, return to the same menu to Sign in with a Microsoft account.

    Note: Switching to a local account forces the system to purge corrupted identity tokens associated with your Microsoft account.