# Agent Authentication & Registration (auth.md)

This document provides machine-readable and human-readable authentication instructions for AI agents, autonomous callers, and programmatic clients connecting to **meetmarek.com**.

## Overview

- **Protected Resource Identifier:** `https://meetmarek.com`
- **Protected Resource Metadata (RFC 9728):** `https://meetmarek.com/.well-known/oauth-protected-resource`
- **Authorization Server Discovery (RFC 8414):** `https://meetmarek.com/.well-known/oauth-authorization-server`
- **OpenID Connect Discovery:** `https://meetmarek.com/.well-known/openid-configuration`

---

## Agent Registration Protocol

AI agents can programmatically register and obtain credentials to submit inquiries, query workshop availability, and schedule sessions with Marek Malinowski.

### 1. Dynamic Agent Registration

- **Endpoint:** `POST https://meetmarek.com/oauth/register`
- **Content-Type:** `application/json`

#### Request Payload:
```json
{
  "client_name": "BookingAgent/1.0",
  "identity_type": "agent",
  "redirect_uris": ["https://agent.example.com/callback"],
  "grant_types": ["client_credentials", "urn:ietf:params:oauth:grant-type:token-exchange"],
  "scope": "inquiry:write workshops:read"
}
```

#### Response:
```json
{
  "client_id": "agent_client_id_placeholder",
  "client_secret": "agent_client_secret_placeholder",
  "client_id_issued_at": 1740000000,
  "client_secret_expires_at": 0
}
```

### 2. Token Issuance

- **Endpoint:** `POST https://meetmarek.com/oauth/token`
- **Grant Types:** `client_credentials`, `authorization_code`

```bash
curl -X POST https://meetmarek.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&scope=inquiry:write"
```

### 3. Supported Scopes

| Scope | Description |
|---|---|
| `inquiry:write` | Submit workshop booking and speaking requests |
| `workshops:read` | Read detailed workshop curriculum and prerequisites |
| `calendar:check` | Check availability slots for Europe/Warsaw timezone |

### 4. Agent Auth Block Specification

As advertised in `/.well-known/oauth-authorization-server`:

```json
{
  "agent_auth": {
    "register_uri": "https://meetmarek.com/oauth/register",
    "supported_identity_types": ["agent", "service", "client"],
    "credential_types": ["api_key", "bearer_token"],
    "claim_url": "https://meetmarek.com/oauth/claim",
    "revocation_url": "https://meetmarek.com/oauth/revoke"
  }
}
```

---

## Contact & Human Escalation

If an agent requires manual intervention or permissions:
- **Email:** marek@meetmarek.com
- **Website:** https://meetmarek.com
