teams Code Sign-In Loop Error

How to Fix Microsoft Teams Error Sign-In Loop Error

Diagnostic Procedures

  • 1 Identify the exact meaning of the error code
  • 2 Clear cache or credentials related to the software
  • 3 Check service server status for outages
  • 4 Perform a repair or reset on the desktop client
  • 5 Re-authenticate the connection to sync files

How to Fix Microsoft Teams Sign-In Loop Error

If you are stuck on a screen where Microsoft Teams continuously reloads, flashes, or prompts you to log in repeatedly in an infinite redirect, you are encountering a Sign-In Loop Error. This occurs when the authentication server verifies your credentials, but the local Teams client fails to receive or store the secure session token.

This guide provides steps to purge corrupt tokens, configure browser cookie parameters, and reset the Windows Web Account Manager (WAM) to break the authentication loop.


1. Identify the Exact Meaning of the Error Code

A Sign-In Loop Error is a state where the Teams client and the Entra ID authentication servers cannot complete a trust agreement.

This is triggered by:

  • Blocked Third-Party Cookies: The Teams client relies on embedded web pages. If your default browser blocks third-party cookies (specifically microsoft.com and microsoftonline.com), the client cannot read the session state.
  • Stale Security Tokens: Stale login credentials are saved in the system, and the application keeps sending outdated security parameters to the server.
  • Corrupt WAM Broker: The Windows Web Account Manager broker is delivering cached, incorrect logins instead of querying the user for fresh credentials.

Purging cached login folders stops the app from attempting to sign in using corrupted, loops-inducing configurations.

A. Windows PowerShell Steps

  1. Stop Microsoft Teams:
    Stop-Process -Name "ms-teams" -Force -ErrorAction SilentlyContinue
  2. Delete cached folders:
    Remove-Item -Path "$env:LOCALAPPDATA\Packages\MSTeams_8wekyb3d8bbwe\*" -Recurse -Force -ErrorAction SilentlyContinue
  3. Open Credential Manager, select Windows Credentials, and delete all keys containing MicrosoftOffice16 or MicrosoftTeams.

B. macOS Terminal Steps

  1. Force quit Teams:
    pkill -9 "Microsoft Teams"
    rm -rf ~/Library/Group\ Containers/UBF8T346G9.com.microsoft.teams
    rm -rf ~/Library/Containers/com.microsoft.teams2
  2. Open Keychain Access and delete all keys matching Microsoft Teams and com.microsoft.teams.adalsession.

3. Check Service Server Status for Outages

  • Check the Microsoft 365 Service Status Page to confirm Entra ID or Teams authentication is not experiencing a service outage.
  • If your system clock is out of sync, authentication requests will fail. Right-click the clock in your system tray, click Adjust date and time, and click Sync Now.

4. Perform a Repair or Reset on the Desktop Client

Resetting the local client application registry and browser settings restores the correct cookies configuration.

A. Reset the Teams Desktop Client (Windows)

  1. Run PowerShell as Administrator.
  2. Reset the package:
    Get-AppxPackage -Name "MSTeams" -AllUsers | Reset-AppxPackage

B. Enable Third-Party Cookies in Microsoft Edge / Chrome

Because Teams uses the system browser rendering engine:

  1. Open Microsoft Edge (or Google Chrome).
  2. Go to SettingsCookies and Site PermissionsManage and delete cookies and site data.
  3. Ensure Block third-party cookies is turned Off.
  4. Alternatively, click Add under Allow and add these domains:
    • [*.]microsoft.com
    • [*.]microsoftonline.com
    • [*.]teams.microsoft.com

5. Re-authenticate the Connection to Sync Files

Bypassing the system WAM broker forces a clean browser-based authentication.

A. Reconnect Work Account (Windows)

  1. Open Settings (Win + I) → AccountsAccess work or school.
  2. Locate your account and click Disconnect.
  3. Reboot your computer.
  4. Open Teams. When prompted to sign in, type your email and complete the login. When the system asks to “Allow my organization to manage my device”, uncheck the box and select “No, sign in to this app only”.

B. Check Web Access

  1. Open an Incognito/InPrivate window in your web browser.
  2. Go to https://teams.microsoft.com and sign in.
  3. If this succeeds, the issue is isolated to your local desktop client. If this fails, there is an account-level lock or policy issue that your IT administrator must resolve in the Entra ID Portal.

6. Summary Quick Reference Checklist

ActionPractical ResolutionExpected Outcome
Allow Third-Party CookiesEnable cookies for *.microsoft.com in default browserRestores authentication cookie sharing.
Choose “This app only”Select “No, sign in to this app only” during loginBypasses corrupted Windows WAM cache loops.
Clear App CacheDelete files in %localappdata%\Packages\MSTeams_8wekyb3d8bbwePurges loops-inducing local app cache.
Sync System TimeRight-click clock -> Click “Sync Now”Resolves SSL and security handshake timing blocks.
Delete Saved KeyringClean Windows Credential Manager / Mac KeychainRemoves stale OAuth and SSO tokens.