[BUG] MS365 plugin OAuth authorization fails with two separate errors

Resolved 💬 4 comments Opened Feb 12, 2026 by albertbertus Closed Mar 13, 2026

Preflight Checklist

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

What's Wrong?

Environment

  • OS: Windows 11 Pro (ThinkPad)
  • Claude Code version: Latest (as of Feb 12, 2026)
  • Plugin: productivity:ms365

Description

When enabling the productivity:ms365 plugin in Claude Code, the OAuth authorization flow fails with two separate errors:

Bug 1: Duplicated prompt parameter (AADSTS9000411)

The authorization URL generated by Claude Code contains the prompt parameter twice:

Note prompt=select_account at the beginning and prompt=consent at the end. Microsoft rejects this with error AADSTS9000411.

Bug 2: Redirect URI mismatch (AADSTS50011)

After manually removing the duplicate prompt parameter and completing the Microsoft consent screen, the callback fails with error AADSTS50011:

The redirect URI 'http://localhost:41287/callback' specified in the request does not match the redirect URIs configured for the application '08ad6f98-a4f8-4635-bb8d-f1a3044760f0'.

The local callback server uses a dynamic port (41287 in this case), which is not registered in the Azure AD app configuration for client ID 08ad6f98-a4f8-4635-bb8d-f1a3044760f0.

What Should Happen?

Expected Behavior

OAuth authorization should complete successfully, with a single prompt parameter and a redirect URI that matches the Azure AD app registration.

Actual Behavior

Authorization fails due to two bugs in the OAuth URL construction.

Error Messages/Logs

Microsoft rejects this with error AADSTS9000411
Redirect URI mismatch (AADSTS50011)

Steps to Reproduce

  1. Open Claude Code
  2. Enable plugin productivity:ms365
  3. Attempt to authorize with Microsoft 365
  4. Observe AADSTS9000411 error (duplicated prompt parameter)
  5. Manually fix URL by removing duplicate prompt parameter
  6. Complete consent screen
  7. Observe AADSTS50011 error (redirect URI mismatch)

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.39 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

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