You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Omit RFC 8707 resource param on refresh_token grants and strip root trailing slash from PRM resource
Two compounding bugs broke silent token refresh against Microsoft Entra
ID v2.0 (AADSTS9010010), causing MCP servers using Entra OAuth to lose
authentication after ~1 hour:
- _refresh_token() sent the RFC 8707 resource parameter on
refresh_token grants, which Entra v2.0 strictly rejects since
March 2026. The parameter is now omitted from refresh requests.
- Pydantic's AnyHttpUrl normalizes bare-domain PRM resource URLs to
include a trailing slash, so the resource audience never matched the
IdP app registration. get_resource_url() now strips the slash, but
only when the path is exactly "/" with no query or fragment - RFC
9728 requires exact-string identity, so intentional trailing slashes
on deeper paths are preserved.
Implements the approach maintainers endorsed when consolidating earlier
attempts (#2590, since closed unmerged; see discussion on #2645/#2646).
Fixes#2578
0 commit comments