Microsoft 365 MCP connector: redirect URI mismatch (AADSTS50011)

Resolved 💬 4 comments Opened Apr 14, 2026 by trisoakes Closed Jun 12, 2026

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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗