# Auth.md

> Agent Registration and Authentication Specification for Ilgiz Zayniev Portfolio & Plays Repertoire.

## Service Discovery
- **Origin**: `https://zayniev.com`
- **Protected Resource Metadata**: `https://zayniev.com/.well-known/oauth-protected-resource`
- **Authorization Server**: `https://zayniev.com/.well-known/oauth-authorization-server`
- **MCP Server Card**: `https://zayniev.com/.well-known/mcp/server-card.json`
- **Agent Skills**: `https://zayniev.com/.well-known/agent-skills/index.json`
- **LLM Manifest**: `https://zayniev.com/llms.txt`

---

## 1. Registration Flow for AI Agents

AI agents and automated tools can register dynamically or read public information without credentials.

### Anonymous Registration
To obtain a scoped session token for querying structured APIs:

```http
POST /api/agents/register HTTP/1.1
Host: zayniev.com
Content-Type: application/json

{
  "type": "anonymous",
  "client_name": "MyAgent/1.0"
}
```

#### Response:
```json
{
  "status": "registered",
  "client_id": "agent_anon_public",
  "token_type": "Bearer",
  "access_token": "zayniev_anon_token_public",
  "expires_in": 86400,
  "scope": "read:plays read:portfolio"
}
```

---

## 2. Token Exchange & Usage

Pass the issued bearer token in the `Authorization` header on all API calls:

```bash
curl -H "Authorization: Bearer zayniev_anon_token_public" https://zayniev.com/llms.txt
```

---

## 3. Supported Scopes
- `read:plays`: Full read access to all 27 Tatar theatre plays, genres, premier dates, and synopses.
- `read:portfolio`: Read access to author biography, awards, Kamal Theatre and Ekiyat Puppet Theatre leadership.

---

## 4. Contact & Identity Revocation
- **Contact Email**: `agent@zayniev.com`
- **Revocation Endpoint**: `POST https://zayniev.com/api/agents/revoke`
