crewAIInc/crewAI · error · A2AClientHTTPError
AgentCard requires {required} authentication, but {type(prov
Error message
AgentCard requires {required} authentication, but {type(provided_auth).__name__} was provided What it means
Error "AgentCard requires {required} authentication, but {type(provided_auth).__name__} was provided" thrown in crewAIInc/crewAI.
Source
Thrown at lib/crewai/src/crewai/a2a/auth/utils.py:115
provided_auth: Actually provided authentication instance.
Raises:
A2AClientHTTPError: Always raises with 401 status code.
"""
if isinstance(expected_classes, tuple):
if len(expected_classes) == 1:
required = expected_classes[0].__name__
else:
names = [cls.__name__ for cls in expected_classes]
required = f"one of ({', '.join(names)})"
else:
required = expected_classes.__name__
msg = (
f"AgentCard requires {required} authentication, "
f"but {type(provided_auth).__name__} was provided"
)
raise A2AClientHTTPError(401, msg)
def parse_www_authenticate(header_value: str) -> dict[str, dict[str, str]]:
"""Parse WWW-Authenticate header into auth challenges.
Args:
header_value: The WWW-Authenticate header value.
Returns:
Dictionary mapping auth scheme to its parameters.
Example: {"Bearer": {"realm": "api", "scope": "read write"}}
"""
if not header_value:
return {}
challenges: dict[str, dict[str, str]] = {}
for match in _SCHEME_PATTERN.finditer(header_value):View on GitHub (pinned to 754d7323be)
Solutions
- Provide the auth scheme type required by the AgentCard (e.g. OAuth2, API key, HTTP).
- Inspect the AgentCard securitySchemes to determine the required auth type.
When it happens
Trigger: Thrown at lib/crewai/src/crewai/a2a/auth/utils.py:115 when the library encounters an invalid state.
Common situations: Occurs when the authentication scheme supplied to the client does not match the scheme required by the AgentCard. Configure the client with the auth scheme type the agent requires.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15).
Data as JSON: /api/errors/5da7ee64581d4963.
Report an issue: GitHub.