{"record":{"id":"82e5f7fc6288cde0","repo":"crewAIInc/crewAI","slug":"agentcard-requires-authentication-but-no-auth-sche","errorCode":null,"errorMessage":"AgentCard requires authentication but no auth scheme provided","messagePattern":"AgentCard requires authentication but no auth scheme provided","errorType":"exception","errorClass":"A2AClientHTTPError","httpStatus":401,"severity":"error","filePath":"lib/crewai/src/crewai/a2a/auth/utils.py","lineNumber":167,"sourceCode":"def validate_auth_against_agent_card(\n    agent_card: AgentCard, auth: ClientAuthScheme | None\n) -> None:\n    \"\"\"Validate that provided auth matches AgentCard security requirements.\n\n    Args:\n        agent_card: The A2A AgentCard containing security requirements.\n        auth: User-provided authentication scheme (or None).\n\n    Raises:\n        A2AClientHTTPError: If auth doesn't match AgentCard requirements (status_code=401).\n    \"\"\"\n\n    if not agent_card.security or not agent_card.security_schemes:\n        return\n\n    if not auth:\n        msg = \"AgentCard requires authentication but no auth scheme provided\"\n        raise A2AClientHTTPError(401, msg)\n\n    first_security_req = agent_card.security[0] if agent_card.security else {}\n\n    for scheme_name in first_security_req:\n        security_scheme_wrapper = agent_card.security_schemes.get(scheme_name)\n        if not security_scheme_wrapper:\n            continue\n\n        scheme = security_scheme_wrapper.root\n\n        if allowed_classes := _SCHEME_AUTH_MAPPING.get(type(scheme)):\n            if not isinstance(auth, allowed_classes):\n                _raise_auth_mismatch(allowed_classes, auth)\n            return\n\n        if isinstance(scheme, HTTPAuthSecurityScheme):\n            scheme_key = cast(_HTTPSchemeType, scheme.scheme.lower())\n            if required_class := _HTTP_SCHEME_MAPPING.get(scheme_key):","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai/src/crewai/a2a/auth/utils.py#L149-L185","documentation":"Error \"AgentCard requires authentication but no auth scheme provided\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai/src/crewai/a2a/auth/utils.py:167 when the library encounters an invalid state.","commonSituations":"Occurs when the target AgentCard requires authentication but the request carries no auth scheme. Provide an authentication scheme matching the AgentCard security requirements.","solutions":["Provide an auth scheme matching the AgentCard's security requirements.","Configure credentials for the remote agent before connecting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}