Posted on

Deep Dive: Fixing the Microsoft.AAD.BrokerPlugin Login Loop

Sometimes, Office breaks so badly that reinstalling it doesn’t help. You click “Sign In,” the window flashes white, and then closes immediately. No error code. No loop. Just… nothing.

This is almost always a corruption of the Universal Windows Platform (UWP) Token Broker, specifically the package Microsoft.AAD.BrokerPlugin.

Since Office 365 now uses Windows 10/11 API to sign in (WAM), if this Windows App is broken, Office cannot authenticate.

Symptoms

  • Outlook says “Need Password” but clicking it does nothing.
  • Teams shows a white screen on launch.
  • Deleting the user profile fixes it to temporary, but it comes back.

The Fix: Re-registering the AppX Package

You cannot fix this from Control Panel. You need PowerShell.

Step 1: Browse to the broken location

Navigate to:
%LOCALAPPDATA%\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy

If you cannot open this folder (Access Denied), or if it is empty, or if there are 0kb files, it is corrupted.

Step 2: Rename the folder

Rename Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy to Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy.OLD.
Note: If it says “File in Use,” restart the computer and try again immediately before launching any apps.

Step 3: Re-register the plugin

Open PowerShell as Administrator and run the following command to tell Windows to “re-install” this system app from its internal manifest:

Add-AppxPackage -Register "$env:windir\SystemApps\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy\Appxmanifest.xml" -DisableDevelopmentMode -ForceApplicationShutdown

Step 4: Verify

Run:

Get-AppxPackage Microsoft.AAD.BrokerPlugin

If it returns information about the package, you are successful.
Launch Outlook. It should now be able to pop the “Modern Authentication” window and ask for your credentials.

Why does this happen?

Anti-virus software or aggressive “System Cleaner” tools often flag the token files inside this package as “Junk” or “Suspicious” because they change frequently. Add an exclusion to your AV for the %LOCALAPPDATA%\Packages\ folder to prevent recurrence.