# Authentication for JUHENZA agents

## Discover

The public MCP servers, the solution-brief API and the OpenAPI document need no credentials:

- `/mcp` (product tools) and `/mcp/docs` (documentation tools), over Streamable HTTP
- `/api/solution-brief` (POST a JSON body), `/api/solution-brief/sandbox` (test mode)
- `/api/jobs/{jobId}` (poll an asynchronous brief)
- `/api/capabilities` (cursor-paginated service list)
- `/openapi.json` and `/llms.txt`
- `/.well-known/mcp/server-card.json` (product server card)
- `/.well-known/oauth-protected-resource` (RFC 9728 protected-resource metadata)
- `/.well-known/oauth-authorization-server` (RFC 8414 authorization-server metadata)

The protected-resource metadata names this origin as the authorization server and lists the
scopes `mcp:read`, `docs:read` and `brief:write`. The authorization-server metadata carries the
auth.md `agent_auth` block below, so an agent can follow the chain from a protected resource to
this page without hitting a dead link.

```json
{
  "issuer": "https://juhenza.com",
  "authorization_servers": ["https://juhenza.com"],
  "agent_auth": {
    "skill": "https://juhenza.com/auth.md",
    "identity_endpoint": "https://juhenza.com/api/agent-auth/identity",
    "claim_endpoint": "https://juhenza.com/api/agent-auth/identity/claim",
    "events_endpoint": "https://juhenza.com/api/agent-auth/events",
    "identity_types_supported": ["anonymous"],
    "identity_assertion": { "assertion_types_supported": [] }
  }
}
```

## Pick a method

No authentication method is required. JUHENZA does not issue API keys or access tokens, and it
does not run a user-account authorization server. The advertised agent-auth endpoints exist so
discovery is traversable:

- `POST /api/agent-auth/identity` returns an anonymous identity record (no assertion, no token).
- `POST /api/agent-auth/identity/claim` returns 501 because anonymous access needs no claim.
- `POST /api/agent-auth/events` returns an empty event list (no identities to revoke).
- `POST /api/agent-auth/token` returns 501 because no token is issued.
- `POST /api/agent-auth/register` returns 501 because there is no client registration.

An `OPTIONS` request to any of these paths returns `204` with CORS headers.

## Errors

Requests that fail validation return an RFC 9457 problem response under `/api/`.
Unknown paths return `404` with a problem body.
A `401` response carries `WWW-Authenticate: Bearer resource_metadata="https://juhenza.com/.well-known/oauth-protected-resource"`.

## Revocation

Not applicable: no credentials are issued.

## Changes

If access control or user accounts are added later, this page will describe the registration and
token flow, the authorization-server metadata will advertise real assertion types, and the
protected-resource metadata will keep naming the authorization server.
