Skip to content

A2A Gateway: JWT/Bearer authentication and end-to-end claims propagation #264

@rockfordlhotka

Description

@rockfordlhotka

Context

Split from #262. The A2A HTTP gateway currently supports X-Api-Key authentication (added in #261). This issue adds JWT/Bearer token authentication as a second scheme and wires end-to-end claims propagation so the agent can independently verify caller identity.

JWT/Bearer token authentication

The gateway's auth infrastructure was designed to support multiple schemes via ASP.NET Core's AddAuthentication().AddScheme() pattern.

  • Add Bearer/JWT authentication scheme as a second option
  • Support JWT sub claim extraction for caller identity
  • Update AgentCard.SecuritySchemes to advertise both API key and Bearer schemes
  • Document OAuth2 configuration options

Open questions

  • Identity provider: Should JWT validation be generic OIDC (validate against a configurable Authority/Audience via jwks_uri), or targeted at a specific provider (Azure AD, Auth0, Keycloak)? Generic OIDC with configurable Authority/Audience seems most flexible.

End-to-end token/claims propagation to the agent

Currently the gateway validates the API key and passes only the caller's string identity as the Source field on the RabbitMQ envelope. The agent trusts this at face value (NameBasedAgentIdentityVerifier, IsSelfAsserted: true). For production hardening, the agent should be able to independently verify the caller.

  • Forward JWT (or extracted claims) through MessageEnvelope custom headers (e.g., rb-auth-token or rb-auth-claims) — the envelope already supports a headers dictionary
  • Implement a new IAgentIdentityVerifier that validates the forwarded token/claims instead of trusting the Source string
  • The new verifier should set IsSelfAsserted: false and populate VerifiedAgentIdentity.Issuer with the IdP issuer and Claims with the verified claims
  • VerifiedAgentIdentity already has Claims, Issuer, and IsSelfAsserted fields designed for this

Notes

  • The existing ApiKeyAuthenticationHandler produces claims (NameIdentifier, Name, custom issuer) that can serve as the pattern for the JWT handler
  • The WellKnownHeaders class can be extended with rb-auth-token / rb-auth-claims constants
  • IAgentIdentityVerifier and VerifiedAgentIdentity are already in RockBot.A2A.Abstractions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions