{"record":{"id":"5da7ee64581d4963","repo":"crewAIInc/crewAI","slug":"agentcard-requires-required-authentication-but","errorCode":null,"errorMessage":"AgentCard requires {required} authentication, but {type(provided_auth).__name__} was provided","messagePattern":"AgentCard requires (.+?) authentication, but (.+?) was provided","errorType":"exception","errorClass":"A2AClientHTTPError","httpStatus":401,"severity":"error","filePath":"lib/crewai/src/crewai/a2a/auth/utils.py","lineNumber":115,"sourceCode":"        provided_auth: Actually provided authentication instance.\n\n    Raises:\n        A2AClientHTTPError: Always raises with 401 status code.\n    \"\"\"\n    if isinstance(expected_classes, tuple):\n        if len(expected_classes) == 1:\n            required = expected_classes[0].__name__\n        else:\n            names = [cls.__name__ for cls in expected_classes]\n            required = f\"one of ({', '.join(names)})\"\n    else:\n        required = expected_classes.__name__\n\n    msg = (\n        f\"AgentCard requires {required} authentication, \"\n        f\"but {type(provided_auth).__name__} was provided\"\n    )\n    raise A2AClientHTTPError(401, msg)\n\n\ndef parse_www_authenticate(header_value: str) -> dict[str, dict[str, str]]:\n    \"\"\"Parse WWW-Authenticate header into auth challenges.\n\n    Args:\n        header_value: The WWW-Authenticate header value.\n\n    Returns:\n        Dictionary mapping auth scheme to its parameters.\n        Example: {\"Bearer\": {\"realm\": \"api\", \"scope\": \"read write\"}}\n    \"\"\"\n    if not header_value:\n        return {}\n\n    challenges: dict[str, dict[str, str]] = {}\n\n    for match in _SCHEME_PATTERN.finditer(header_value):","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai/src/crewai/a2a/auth/utils.py#L97-L133","documentation":"Error \"AgentCard requires {required} authentication, but {type(provided_auth).__name__} was provided\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai/src/crewai/a2a/auth/utils.py:115 when the library encounters an invalid state.","commonSituations":"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.","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."],"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-15T17:31:12.345Z"}