a2a-authentication

Implement A2A authentication — API keys, Bearer tokens, OAuth 2.0, OpenID Connect, and mutual TLS. Use when securing agent-to-agent communication and configuring Agent Card security schemes.

17 stars

Best use case

a2a-authentication is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Implement A2A authentication — API keys, Bearer tokens, OAuth 2.0, OpenID Connect, and mutual TLS. Use when securing agent-to-agent communication and configuring Agent Card security schemes.

Teams using a2a-authentication should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/a2a-authentication/SKILL.md --create-dirs "https://raw.githubusercontent.com/OrcaQubits/agentic-commerce-skills-plugins/main/a2a-multi-agent/skills/a2a-authentication/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/a2a-authentication/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How a2a-authentication Compares

Feature / Agenta2a-authenticationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Implement A2A authentication — API keys, Bearer tokens, OAuth 2.0, OpenID Connect, and mutual TLS. Use when securing agent-to-agent communication and configuring Agent Card security schemes.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# A2A Authentication

## Before writing code

**Fetch live docs**:
1. Fetch `https://a2a-protocol.org/latest/specification/` for the authentication and security section
2. Web-search `site:github.com a2aproject A2A authentication security schemes` for auth scheme details
3. Web-search `site:github.com a2aproject a2a-samples authentication` for auth implementation examples
4. Fetch SDK docs for authentication middleware and client credential handling

## Conceptual Architecture

### Why Authentication Matters

In multi-agent systems, agents must verify each other's identity and authorize access:
- **Server agents** need to know who's calling them and whether they're authorized
- **Client agents** need to present valid credentials to access server agents
- **Agent Cards** declare what authentication is required upfront

### Five Security Schemes

A2A supports the same security scheme types as OpenAPI 3.0:

#### 1. API Key (`apiKey`)
A static key sent in a header or query parameter.
- **Best for**: Internal agents, simple integrations, development
- **Agent Card declares**: Header name and location
- **Client provides**: The key value in the specified header

#### 2. HTTP Bearer (`http` with `scheme: bearer`)
A bearer token (JWT or opaque) in the `Authorization` header.
- **Best for**: Token-based auth, service-to-service with JWTs
- **Agent Card declares**: Bearer scheme, optional format hint
- **Client provides**: `Authorization: Bearer <token>`

#### 3. OAuth 2.0 (`oauth2`)
Standard OAuth 2.0 flows for token acquisition.
- **Best for**: Production systems, fine-grained scopes, delegated access
- **Agent Card declares**: OAuth flows (clientCredentials, authorizationCode), token URL, scopes
- **Client provides**: Access token obtained from the OAuth server

Common flow for agent-to-agent: **Client Credentials** (machine-to-machine, no user involvement).

#### 4. OpenID Connect (`openIdConnect`)
OIDC discovery-based authentication.
- **Best for**: Enterprise systems with identity providers, SSO environments
- **Agent Card declares**: OIDC discovery URL (`openIdConnectUrl`)
- **Client provides**: Token obtained via OIDC flow

#### 5. Mutual TLS (`mutualTLS`)
Client certificate-based authentication.
- **Best for**: High-security environments, zero-trust networks
- **Agent Card declares**: mTLS requirement
- **Client provides**: Client certificate during TLS handshake

### Agent Card Authentication Declaration

Authentication requirements are declared in the Agent Card using two top-level fields, `securitySchemes` (a map of named scheme definitions) and `security` (an array of required scheme references):
```json
{
  "securitySchemes": {
    "oauth2_auth": {
      "type": "oauth2",
      "flows": {
        "clientCredentials": {
          "tokenUrl": "https://auth.example.com/token",
          "scopes": {
            "agent:read": "Read access",
            "agent:write": "Write access"
          }
        }
      }
    }
  },
  "security": [
    { "oauth2_auth": [] }
  ]
}
```

### Extended Agent Card

The `agent/authenticatedExtendedCard` method allows agents to return a richer Agent Card to authenticated clients — exposing additional skills or capabilities that aren't visible to unauthenticated discovery.

### Auth-Required State

If a task requires authentication mid-flow:
1. Server transitions task to `auth-required` state
2. Status message includes auth instructions
3. Client authenticates and resumes the task
4. Server transitions back to `working`

### Best Practices

- Always use HTTPS for A2A communication in production
- Prefer OAuth 2.0 client credentials for production agent-to-agent auth
- Use API keys only for development or internal low-risk scenarios
- Rotate credentials regularly and support credential refresh
- Declare authentication in the Agent Card so clients know requirements before calling
- Implement rate limiting alongside authentication
- Log authentication failures for security monitoring
- Use the `auth-required` task state for dynamic auth challenges

Fetch the specification for exact authentication schema structures, security scheme field names, and the extended card method before implementing.

Related Skills

webmcp-authentication

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement WebMCP authentication patterns — browser session inheritance, cookie-based auth, role-gated tool registration, and conditional tool exposure. Use when managing which tools are available based on user authentication state.

woo-testing

17
from OrcaQubits/agentic-commerce-skills-plugins

Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.

woo-shipping

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.

woo-setup

17
from OrcaQubits/agentic-commerce-skills-plugins

Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.

woo-security

17
from OrcaQubits/agentic-commerce-skills-plugins

Implement WooCommerce security — nonces, capabilities, input sanitization, output escaping, data validation, PCI compliance considerations, and WordPress security best practices. Use when hardening a WooCommerce store or reviewing security posture.

woo-plugin-dev

17
from OrcaQubits/agentic-commerce-skills-plugins

Create WooCommerce extensions/plugins — file structure, main plugin file, activation/deactivation hooks, custom database tables, autoloading, and WordPress plugin API. Use when building new WooCommerce extensions or structuring plugin code.

woo-performance

17
from OrcaQubits/agentic-commerce-skills-plugins

Optimize WooCommerce performance — object caching, transients, HPOS, database optimization, Action Scheduler, lazy loading, and query optimization. Use when improving store performance or diagnosing slowness.

woo-payments

17
from OrcaQubits/agentic-commerce-skills-plugins

Build WooCommerce payment gateways — WC_Payment_Gateway, direct/redirect/hosted integrations, tokenization, subscriptions support, refunds, and PCI compliance. Use when creating custom payment method integrations.

woo-hooks-filters

17
from OrcaQubits/agentic-commerce-skills-plugins

Master the WordPress hook system for WooCommerce — actions, filters, hook priorities, WooCommerce-specific hooks, and extensibility patterns. Use when adding functionality via hooks or understanding the WooCommerce execution flow.

woo-frontend

17
from OrcaQubits/agentic-commerce-skills-plugins

Customize WooCommerce frontend — template overrides, theme integration, shortcodes, hooks for product/cart/checkout display, and WooCommerce block themes. Use when modifying the storefront appearance or building WooCommerce themes.

woo-deploy

17
from OrcaQubits/agentic-commerce-skills-plugins

Deploy WooCommerce — WP-CLI automation, database migrations, zero-downtime updates, staging workflows, environment configuration, and CI/CD patterns. Use when deploying WooCommerce stores or setting up deployment pipelines.

woo-data-stores

17
from OrcaQubits/agentic-commerce-skills-plugins

Work with WooCommerce CRUD data stores — WC_Product, WC_Order, WC_Customer, WC_Coupon data objects, custom data stores, HPOS migration, and getters/setters. Use when creating or modifying WooCommerce data objects or implementing custom data stores.