Loading

Microsoft Teams and OneDrive Connectors (Mule 4): Intermittent INVALID_CREDENTIALS / “Invalid token lifetime” — OAuth token refresh does not occur after a Microsoft 401 response change

Julkaisupäivä: Oct 1, 2026
Kuvaus

Applies to

  • Anypoint Connector for Microsoft Teams (Mule 4) — all released versions up to and including 1.1.5; no fixed version yet

  • Anypoint Connector for Microsoft OneDrive (Mule 4) — all released versions up to and including 1.2.0; no fixed version yet

Both authenticate to Microsoft Graph via OAuth 2.0 (authorization-code or client-credentials).

Symptom

Operations intermittently fail and the connector does not recover on its own:

  • Microsoft Teams: error type MICROSOFTTEAMS:INVALID_CREDENTIALS — message "Invalid token lifetime."

  • Microsoft OneDrive: UNAUTHORIZED - Invalid Credentials — message "Invalid token lifetime."

The underlying Microsoft response is an HTTP 401 Unauthorized (InvalidAuthenticationToken) during token renewal. After the first 401, the connector fails to refresh the OAuth access token; all subsequent operations keep failing until the Mule application is restarted. After a restart it works again, but the failure recurs approximately 1 to 1.5 hours later (the next token-expiry cycle). No code, deployment, or configuration change is made on the customer side before the issue begins.

Cause

Both connectors decide whether to refresh the OAuth token by matching the text of the Microsoft 401 response body against a hardcoded list — rather than acting on the HTTP 401 status code. They trigger a refresh only when the 401 body contains one of:

  • "Access token has expired or is not yet valid."

  • "Lifetime validation failed, the token is expired."

Microsoft Graph has started returning "Invalid token lifetime" for the same token-renewal scenario. Because this message matches neither hardcoded string, the connector does not recognize it as an expired-token condition, does not trigger the refresh, and surfaces an INVALID_CREDENTIALS / UNAUTHORIZED error instead.

This is a recurring text-matching dependency: a prior Microsoft wording change ("Lifetime validation failed, the token is expired.") was previously handled by adding that string to the list, so any further change to Microsoft's 401 wording re-introduces the failure.

Ratkaisu

The durable fix is for the connector to base its token-refresh decision on the HTTP 401 status code alone, independent of Microsoft's error wording , the same change already delivered in the Microsoft Outlook 365 Connector in version 1.3.2.


Microsoft Teams Connector — fix in progress; no fixed version available yet.
Microsoft OneDrive Connector — fix in progress; no fixed version available yet.

This article will be updated with the fixed connector versions when they are published. Please monitor the connector release notes.


Workaround:-Restart the Mule application to clear the expired token and restore connectivity. This is a temporary mitigation only — the error returns after the next token expiry (~1–1.5 hours). A scheduled restart ahead of the token-expiry boundary can reduce impact, but there is no durable workaround until a fixed connector version is released.

Knowledge-artikkelin numero

005460907

 
Ladataan
Salesforce Help | Article