Skip to content

feat: Added generic client hooks for HTTP based authentication, and improved agent.json resolution #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mprynce
Copy link

@mprynce mprynce commented Jun 19, 2025

This PR adds a generic client hook for HTTP based authentication. This allows protocols, like the Agentic Profile, to implement Decentralized ID (DID)/JWT based authentication which then enables user, business, and gov scoped identity for A2A agents. When an authHandler is provided and an HTTP 401 is received, the client will try a second time (see the A2AClient._fetch() function) with revised auth headers if new ones are made available by the authHandler.

This PR also improves the client agent card resolution. Previously the card was always found at /.well-known/agent.json which is only correct for agents at the URL path root. For agents with paths, such as https://example.com/agents/coder the URL for the agent card should be https://example.com/agents/coder/agent.json. This PR fixes the error.

I've moved the previous Eliza sample agent to a separate PR into a2a-samples. The Eliza sample provides A2A server side authentication, and a modified A2A CLI with authentication.

The Eliza sample code relies on this PR to function.

@mprynce mprynce requested a review from a team as a code owner June 19, 2025 23:40
@mprynce mprynce requested a review from zeroasterisk June 19, 2025 23:40
@mprynce mprynce changed the title Added generic client hooks for HTTP based authentication, and improved agent.json resolution feat: Added generic client hooks for HTTP based authentication, and improved agent.json resolution Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant