fastmcp/tests/server/auth/providers
Jeremiah Lowin a1a5cca765
Fix Azure scope mismatch causing MCP client validation errors (#2243)
* Fix Azure scope mismatch causing MCP client validation errors

The AzureProvider was prefixing scopes during authorization but not in
token validation or Protected Resource Metadata, causing MCP clients to
reject tokens with "Server granted unauthorized scopes".

Changes:
- Prefix required_scopes once during __init__ and use consistently
- Pass prefixed scopes to JWTVerifier for token validation
- PRM now advertises prefixed scopes to MCP clients
- Remove unnecessary idempotent prefixing logic in authorize()
- Update comprehensive documentation explaining scope handling
- Update tests to reflect corrected behavior

Closes #2151

* Clarify that identifier_uri is optional in docstring
2025-10-24 17:45:49 -04:00
..
__init__.py Add WorkOS and Azure OAuth providers (#1550) 2025-08-20 16:22:03 -04:00
test_auth0.py chore: Set redirect_path default in function (#1833) 2025-09-15 18:33:44 -04:00
test_aws.py Add AWS Cognito OAuth Provider for Enterprise Authentication (#1873) 2025-09-25 11:08:45 -04:00
test_azure.py Fix Azure scope mismatch causing MCP client validation errors (#2243) 2025-10-24 17:45:49 -04:00
test_descope.py Replace subprocess tests with in-process async servers (#2006) 2025-10-19 10:47:54 -04:00
test_github.py Replace subprocess tests with in-process async servers (#2006) 2025-10-19 10:47:54 -04:00
test_google.py Fix OAuth resource URL handling and WWW-Authenticate header (#1706) 2025-09-02 15:14:05 -04:00
test_introspection.py Add RFC 7662 token introspection provider (#2074) 2025-10-16 10:57:06 -04:00
test_scalekit.py Replace subprocess tests with in-process async servers (#2006) 2025-10-19 10:47:54 -04:00
test_supabase.py Add supabase auth (#1997) 2025-10-08 20:27:55 -04:00
test_workos.py Replace subprocess tests with in-process async servers (#2006) 2025-10-19 10:47:54 -04:00