claude-code - 💡(How to fix) Fix Microsoft 365 MCP connector: redirect URI mismatch (AADSTS50011) [1 participants]

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…
GitHub stats
anthropics/claude-code#47975Fetched 2026-04-15 06:36:58
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

AADSTS50011: The redirect URI 'http://localhost:44548/callback' specified in the request does not match the redirect URIs configured for the application '08ad6f98-a4f8-4635-bb8d-f1a3044760f0'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal.

Request Id: 655a81cc-bc05-4833-80f7-f9c663de2400 Correlation Id: 66ede980-4c88-4e40-ab88-be8c92c7e804 Timestamp: 2026-04-14T15:25:48Z App ID: 08ad6f98-a4f8-4635-bb8d-f1a3044760f0

Code Example

AADSTS50011: The redirect URI 'http://localhost:44548/callback' specified in the request does not match the redirect URIs configured for the application '08ad6f98-a4f8-4635-bb8d-f1a3044760f0'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal.
RAW_BUFFERClick to expand / collapse

Bug Description

The Microsoft 365 MCP connector fails to authenticate with Entra ID (Azure AD) corporate tenants due to a redirect URI mismatch. The OAuth callback uses a dynamic localhost port that isn't registered in the app registration.

Error

AADSTS50011: The redirect URI 'http://localhost:44548/callback' specified in the request does not match the redirect URIs configured for the application '08ad6f98-a4f8-4635-bb8d-f1a3044760f0'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal.

Request Id: 655a81cc-bc05-4833-80f7-f9c663de2400 Correlation Id: 66ede980-4c88-4e40-ab88-be8c92c7e804 Timestamp: 2026-04-14T15:25:48Z App ID: 08ad6f98-a4f8-4635-bb8d-f1a3044760f0

Steps to Reproduce

  1. Open Claude Code on Windows 11 Enterprise (Entra ID joined)
  2. Run /mcp and select the official Microsoft 365 connector
  3. Attempt to authenticate
  4. Browser opens to Microsoft login, completes login, then Entra ID rejects the redirect

Expected Behavior

OAuth callback should use a redirect URI that is registered in the app registration (either a fixed port or wildcard localhost pattern).

Environment

  • OS: Windows 11 Enterprise 10.0.26100
  • Claude Code: CLI (latest)
  • Tenant type: Corporate Entra ID (Azure AD)
  • Date: 2026-04-14

extent analysis

TL;DR

The Microsoft 365 MCP connector authentication issue can be resolved by registering the dynamic localhost port or a wildcard localhost pattern in the Azure AD app registration.

Guidance

  • Verify the redirect URI configured in the Azure portal matches the one used by the OAuth callback, which in this case is http://localhost:44548/callback.
  • Update the app registration to include the dynamic localhost port or use a wildcard pattern (e.g., http://localhost/*) to allow any port.
  • Ensure the Claude Code configuration is set to use a fixed port or the wildcard pattern that matches the app registration.
  • Test the authentication flow again after updating the app registration to confirm the fix.

Example

No code snippet is provided as the issue is related to configuration and app registration.

Notes

The solution assumes that the dynamic port used by the OAuth callback can be registered in the Azure AD app registration. If the port is truly dynamic and cannot be predicted, a wildcard pattern may be the only viable solution.

Recommendation

Apply workaround: Register a wildcard localhost pattern (e.g., http://localhost/*) in the Azure AD app registration to allow any port, as this is a more flexible solution that accommodates dynamic ports.

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

claude-code - 💡(How to fix) Fix Microsoft 365 MCP connector: redirect URI mismatch (AADSTS50011) [1 participants]