Skip to content

[FEATURE] Implement Complete A2A Authentication Flow #40

@claude

Description

@claude

Based on investigation in #33, the current A2A authentication implementation is incomplete and doesn''t fully follow the A2A specification. This issue tracks the required improvements.

Summary

The authentication flow should work as specified in the A2A protocol:

  1. Client retrieves agent card and examines security requirements
  2. Client authenticates using appropriate security scheme
  3. Client can request authenticated extended card for additional capabilities
  4. All subsequent requests use proper authentication

Missing Components

1. agent/getAuthenticatedExtendedCard Method

  • Implement agent/getAuthenticatedExtendedCard JSON-RPC method in server.go
  • Add handler method to return extended agent card for authenticated users
  • Return AuthenticatedExtendedCardNotConfiguredError (-32007) when not configured
  • Add configuration option for extended card support

2. Security Scheme Declaration in Agent Cards

  • Populate security and securitySchemes fields in agent cards
  • Add builder methods for common security schemes (OIDC, API Key, etc.)
  • Set supportsAuthenticatedExtendedCard flag appropriately
  • Update agent card generation to include current security configuration

3. Client-Side Authentication Support

  • Add GetAuthenticatedExtendedCard() method to A2A client interface
  • Support authentication headers in client requests
  • Add authentication configuration to client config
  • Implement security scheme negotiation based on agent card

4. Security Requirement Validation

  • Validate that incoming requests meet declared security requirements
  • Implement proper authorization checks beyond authentication
  • Add support for multiple security schemes as alternatives
  • Handle skill-specific security requirements

5. Extended Security Schemes

  • Implement API Key authentication middleware
  • Add support for multiple OAuth2 flows beyond OIDC
  • Add mutual TLS authentication support
  • Ensure all security schemes from A2A spec are supported

Acceptance Criteria

  • Authentication works as described in A2A specification
  • Client can discover and use agent authentication requirements
  • Authenticated users can access extended agent card information
  • All security schemes defined in A2A spec are supported
  • Integration tests validate the complete authentication flow
  • Documentation explains how to configure and use authentication

References

Priority

High - Authentication is a core security requirement for production A2A deployments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions