claude-code - 💡(How to fix) Fix [BUG] M365 connector fails with AADSTS50011 in Cowork — localhost vs 127.0.0.1 redirect URI mismatch

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

The M365 connector in Cowork mode fails to authenticate. Claude Desktop is generating http://localhost:62863/callback as the redirect URI, but the Azure app registration expects http://127.0.0.1/callback. This causes an AADSTS50011 error and the integration is completely broken.

Error Messages/Logs

Error AADSTS50011 is returned — redirect URI mismatch

Code Example

AADSTS50011: The redirect URI 'http://localhost:62863/callback' does not match the redirect URIs configured for the application. Ensure the redirect URI sent in the OIDC/OAuth request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The M365 connector in Cowork mode fails to authenticate. Claude Desktop is generating http://localhost:62863/callback as the redirect URI, but the Azure app registration expects http://127.0.0.1/callback. This causes an AADSTS50011 error and the integration is completely broken.

OS: macOS Claude Desktop version: 1.92552 (1dc8f7) Account: M365 Business Basic

What Should Happen?

Expected behaviour: Successful OAuth authorisation and M365 connection established. Actual behaviour: Browser returns: AADSTS50011 — The redirect URI http://localhost:62863/callback does not match the redirect URIs configured for the application. Expected: http://127.0.0.1/callback Environment:

Error Messages/Logs

AADSTS50011: The redirect URI 'http://localhost:62863/callback' does not match the redirect URIs configured for the application. Ensure the redirect URI sent in the OIDC/OAuth request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

Steps to Reproduce

Open Claude Desktop in Cowork mode Attempt to connect the Microsoft 365 plugin Click the authorisation link Error AADSTS50011 is returned — redirect URI mismatch

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.92552 (1dc8f7)

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This bug is in Claude Desktop Cowork mode, not Claude Code CLI. The M365 connector OAuth flow generates http://localhost with a dynamic port, which does not match the http://127.0.0.1/callback registered in Anthropic's Azure app. Confirmed with Anthropic support chat who acknowledged it is a known configuration issue requiring an engineering fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING