Skip to content

[BUG] M365 MCP OAuth fails with AADSTS9000411 - parameter 'prompt' is duplicated #31089

Closed

Description

@stefanlindqvist

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?

When authenticating the Microsoft 365 MCP connector via /mcp in Claude Code,
the OAuth redirect to Microsoft Entra ID fails with:

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

This suggests the OAuth authorization URL being constructed by Claude Code
sends the prompt parameter twice.

What Should Happen?

The authentication via browser should trigger an account selection dialog for authentication.

Error Messages/Logs

- Request Id: 5fbd47a4-6cc2-4ce2-8255-1632a4264700
- Correlation Id: 67e883f1-c921-4728-aeec-c70b6df03547
- Timestamp: 2026-03-05T13:44:50Z

Steps to Reproduce

  1. Have Microsoft 365 MCP server configured in settings.json
  2. Run claude and enter /mcp
  3. Select Microsoft 365 and authenticate
  4. Browser opens to Microsoft sign-in and immediately shows the error

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.58 (native)

Platform

Other

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Image

Activity

  1. github-actions commented on Mar 5, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Microsoft 365 MCP Server authentication fails with AADSTS9000411: duplicated 'prompt' parameter #21309
    2. MCP OAuth: duplicate 'prompt' parameter in Microsoft 365 authorize URL #23560
    3. OAuth: Duplicate prompt=consent parameter in Microsoft 365 MCP authorization URL #23593

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. RealfinityKipper commented on Mar 8, 2026

    @RealfinityKipper

    having this same issue, additionally once I remove the duplicate prompt parameter manually and retry it gives a callback error
    AADSTS50011: The redirect URI 'http://localhost:52024/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. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

  3. dimisant commented on Mar 16, 2026

    @dimisant

    Still hitting this issue on v2.1.76

  4. mikaelfun commented on Mar 17, 2026

    @mikaelfun

    still having issue

  5. mh-dh commented on Mar 20, 2026

    @mh-dh

    Same Issue here per Microsoft 365 Connector in Claude.ai

  6. mcplunk-code commented on Mar 27, 2026

    @mcplunk-code

    Hitting this same issue on Mac, Claude Code v2.1.84, Autodesk Microsoft tenant.

  7. apstanto commented on Mar 28, 2026

    @apstanto

    Same issue on 2.1.86. Any workaround available?

  8. dnzhng17 commented on Mar 30, 2026

    @dnzhng17

    Continues to be an issue on 2.1.87.

  9. Nolander75 commented on Apr 6, 2026

    @Nolander75

    The Microsoft 365 MCP server (mcp__m365__* tools) fails to authenticate via OAuth. The Azure AD login page returns:

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

    Steps to Reproduce

    1. Open Claude Code with the Microsoft 365 MCP server configured
    2. Run /mcp and attempt to authenticate the Microsoft365 MCP
    3. OAuth flow fails with AADSTS9000411

    Expected Behavior

    OAuth flow completes successfully and M365 tools become available.

    Actual Behavior

    Azure AD rejects the auth request because the prompt parameter is sent twice in the OAuth URL, which is a malformed request per OAuth 2.0 spec.

    Environment

    • OS: Windows 11 Enterprise 10.0.26100
    • Claude Code version: (check with claude --version)
    • Tenant: T-Mobile USA (Azure AD tenant)

    Root Cause (suspected)

    The MCP server's OAuth flow is appending prompt=... twice to the authorization URL. Azure AD enforces strict parameter deduplication and rejects the
    request.

    Workaround

    Using Azure CLI + Microsoft Graph API directly works fine:
    az account get-access-token --resource "https://graph.microsoft.com"

  10. rpeaston commented on Apr 9, 2026

    @rpeaston

    I have this same issue on version 2.1.97.

  11. apstanto commented on Apr 9, 2026

    @apstanto

    Confirmed — bypassing the MCP proxy and calling Microsoft Graph API directly works. Registered my own Azure AD app with device code flow and have had full email and Teams access restored for 2 days.

  12. shayandes-stack commented on Apr 16, 2026

    @shayandes-stack

    Im trying to connect Microsoft 365 to Claude AI and getting the same error. Any workarounds?

  13. ssopotov-cai commented on Apr 23, 2026

    @ssopotov-cai

    Reproduced on Windows 11 with Claude Code 2.1.58 (native), VS Code integrated terminal. Same AADSTS9000411 with the exact URL shape (prompt=select_account ... prompt=consent).

    (Originally filed separately as #52444 before finding this issue.)

  14. dimisant commented on Apr 27, 2026

    @dimisant

    Still not working for me even though th bug is closed.

  15. mh-dh commented on Apr 27, 2026

    @mh-dh

    Still not working for me even though th bug is closed.

    Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ?

  16. dimisant commented on Apr 27, 2026

    @dimisant

    Still not working for me even though th bug is closed.

    Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ?

    Thanks for the reply. I'm not sure, I'm just a non-technical guy playing with claude code. I just assumed that if something else was blocking it then I would get a different error from last time. That would make sense, right? I will nevertheless try to troubleshoot it with CC

  17. mh-dh commented on Apr 27, 2026

    @mh-dh

    Still not working for me even though th bug is closed.

    Are you sure that your Entra Tenant has no Conditional Access Policies blocking this ?

    Thanks for the reply. I'm not sure, I'm just a non-technical guy playing with claude code. I just assumed that if something else was blocking it then I would get a different error from last time. That would make sense, right? I will nevertheless try to troubleshoot it with CC

    Its Common for enterprises with Microsoft / Entra Tenant to have Conditional Access policies whci enforce MFA or block access from certain countries or only allow company Owned Devices etc. and the Anthropic Servers may be blocked by those Policies. This would cause this issue. Thing is: we get the Error from this thread here and not the "correct" error that a policy blocked it.

  18. github-actions commented on May 7, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  19. locked as resolved and limited conversation to collaborators on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:autharea:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions