claude-code - 💡(How to fix) Fix [BUG] Microsoft 365 MCP authentication fails — AADSTS9000411: duplicate 'prompt' parameter in OAuth request [2 comments, 2 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#52037Fetched 2026-04-23 07:38:15
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2closed ×1

Error Message

fails immediately with an Azure AD error indicating the OAuth authorization

Error

Error Messages/Logs

Root Cause

Root Cause (suspected)

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?

Description

Attempting to authenticate the Microsoft 365 remote MCP server (mcp__microsoft365__authenticate) fails immediately with an Azure AD error indicating the OAuth authorization URL has the prompt query parameter duplicated.

Error

AADSTS9000411: The request is not properly formatted. The parameter 'prompt' is duplicated.

Request Id: 3e814799-a557-4a40-862c-6dd5bd5e0900 Correlation Id: 87fccf75-1a72-4261-b55b-24183bcc13fb Timestamp: 2026-04-22T16:19:45Z

Environment

  • Claude Code CLI (darwin / zsh)
  • MCP server: microsoft365 (remote/hosted, claude.ai)
  • Auth has never completed — no entry in ~/.claude/mcp-needs-auth-cache.json

Steps to Reproduce

  1. Open Claude Code in a session
  2. Trigger Microsoft 365 MCP authentication (e.g., invoke mcp__microsoft365__authenticate)
  3. Follow the auth URL provided
  4. Azure AD immediately returns AADSTS9000411

Expected Behavior

OAuth flow completes successfully and Microsoft 365 tools become available.

Root Cause (suspected)

The OAuth authorization URL constructed by the M365 MCP server includes the prompt parameter twice (e.g., from both the base request and extraQueryParameters). Azure AD rejects any request with duplicate parameters per OAuth spec.

The Microsoft correlation/request IDs above can be used to trace the exact malformed request on the Azure AD side.

What Should Happen?

Expected Behavior

OAuth flow completes successfully and Microsoft 365 tools become available.

Root Cause (suspected)

The OAuth authorization URL constructed by the M365 MCP server includes the prompt parameter twice (e.g., from both the base request and extraQueryParameters). Azure AD rejects any request with duplicate parameters per OAuth spec.

The Microsoft correlation/request IDs above can be used to trace the exact malformed request on the Azure AD side.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Open Claude Code in a session
  2. Trigger Microsoft 365 MCP authentication (e.g., invoke mcp__microsoft365__authenticate)
  3. Follow the auth URL provided
  4. Azure AD immediately returns AADSTS9000411

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.104 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

Remove the duplicate prompt parameter from the OAuth authorization URL constructed by the M365 MCP server to resolve the Azure AD error.

Guidance

  • Review the M365 MCP server code to identify where the prompt parameter is being added twice, potentially from both the base request and extraQueryParameters.
  • Verify the OAuth authorization URL construction logic to ensure that parameters are not duplicated.
  • Check the Azure AD documentation to confirm the correct usage of the prompt parameter in OAuth requests.
  • Consider logging or debugging the OAuth authorization URL construction process to identify the exact point where the duplicate parameter is introduced.

Example

No code snippet is provided as the issue does not include specific code references.

Notes

The root cause is suspected to be related to the duplicate prompt parameter, but further investigation is needed to confirm the exact issue.

Recommendation

Apply a workaround to remove the duplicate prompt parameter from the OAuth authorization URL, as the issue is likely caused by a misconfiguration or bug in the M365 MCP server code.

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 [BUG] Microsoft 365 MCP authentication fails — AADSTS9000411: duplicate 'prompt' parameter in OAuth request [2 comments, 2 participants]