Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

add azp claim (#1945)

Roee Hershko541822f07ff2
diff --git a/src/fastmcp/server/auth/providers/jwt.py b/src/fastmcp/server/auth/providers/jwt.py
index c33d122ef..552654ff7 100644
--- a/src/fastmcp/server/auth/providers/jwt.py
+++ b/src/fastmcp/server/auth/providers/jwt.py
@@ -382,7 +382,12 @@ class JWTVerifier(TokenVerifier):
claims = self.jwt.decode(token, verification_key)
# Extract client ID early for logging
- client_id = claims.get("client_id") or claims.get("sub") or "unknown"
+ client_id = (
+ claims.get("client_id")
+ or claims.get("azp")
+ or claims.get("sub")
+ or "unknown"
+ )
# Validate expiration
exp = claims.get("exp")