fastmcp/tests/server/auth
Nathan 76f054e957
fix: enforce redirect URI validation when allowed_client_redirect_uris is supplied (#3066)
* fix: enforce redirect URI validation when patterns are explicitly configured

Security fix: When allowed_redirect_uri_patterns is explicitly set, reject redirect URIs that don't match the patterns instead of falling back to parent validation. This prevents unauthorized OAuth clients from bypassing the allowlist and accessing protected resources.

* Update models.py

no need to return twice

* fix redirect uri access issue

* update style

* feat: add unit test to enforce fallback not applied when redirect uri's supplied

* fix: improve test case

* apply linter

* refactor: simplify logic and do not exposed allowed redirect patterns

---------

Co-authored-by: Nathan <2381793w@student.gla.ac.uk>
2026-02-04 17:33:33 -05:00
..
oauth_proxy Use MemoryStore for OAuth proxy tests 2026-02-01 02:30:05 +00:00
providers Add AzureJWTVerifier for Managed Identity token verification (#3058) 2026-02-02 19:59:13 -05:00
__init__.py Add WorkOS and Azure OAuth providers (#1550) 2025-08-20 16:22:03 -04:00
test_auth_provider.py Upgrade to MCP 1.17+ with RFC 9728 compliance (#2122) 2025-10-17 09:29:23 -04:00
test_authorization.py Unify discovery API: deduplicate at protocol layer only (#2919) 2026-01-18 21:01:53 -05:00
test_debug_verifier.py Add DebugTokenVerifier with custom sync/async validation (#2296) 2025-10-31 10:38:01 -04:00
test_enhanced_error_responses.py Use MemoryStore for OAuth proxy tests 2026-02-01 02:30:05 +00:00
test_jwt_issuer.py feat: option to add upstream claims to the FastMCP proxy JWT (#2997) 2026-01-28 15:57:24 -05:00
test_jwt_provider.py Add AzureJWTVerifier for Managed Identity token verification (#3058) 2026-02-02 19:59:13 -05:00
test_oauth_consent_flow.py Refactor OAuthProxy into focused modules (#2935) 2026-01-19 10:10:07 -05:00
test_oauth_mounting.py Use MemoryStore for OAuth proxy tests 2026-02-01 02:30:05 +00:00
test_oauth_proxy_redirect_validation.py fix: enforce redirect URI validation when allowed_client_redirect_uris is supplied (#3066) 2026-02-04 17:33:33 -05:00
test_oauth_proxy_storage.py Update tests for client_secret=None behavior 2025-12-03 15:48:47 -05:00
test_oidc_proxy.py Add extra_authorize_params and extra_token_params to OIDCProxy 2025-11-17 11:57:58 -05:00
test_redirect_validation.py Fix OAuth redirect URI validation for DCR compatibility (#1661) 2025-08-28 15:19:56 -04:00
test_remote_auth_provider.py Add AzureJWTVerifier for Managed Identity token verification (#3058) 2026-02-02 19:59:13 -05:00
test_static_token_verifier.py Add documentation for get_access_token() dependency function (#1446) 2025-08-11 13:01:44 -04:00