# auth.md

Churchill's Fine Cigars (churchillsaz.com) — Agent Authentication & Access Guide

## Overview

All public content on churchillsaz.com is freely readable without any credentials. Agents may also register anonymously to receive a bearer token accepted on all content endpoints.

## Discovery

| Document | URL |
|---|---|
| OAuth Protected Resource | `https://churchillsaz.com/.well-known/oauth-protected-resource` |
| Authorization Server | `https://churchillsaz.com/.well-known/oauth-authorization-server` |
| JWKS | `https://churchillsaz.com/.well-known/jwks.json` |

## Agent Registration

Anonymous registration is supported. Agents that register receive a short-lived bearer token (`read:content` scope) usable on all endpoints.

### Step 1 — Register

```
POST https://churchillsaz.com/api/agent/identity
Content-Type: application/json

{ "type": "anonymous" }
```

### Step 2 — Exchange for a token

```
POST https://churchillsaz.com/api/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&scope=read%3Acontent
```

Response:

```json
{
  "access_token": "<token>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "read:content"
}
```

### Step 3 — Use the token

Send `Authorization: Bearer <token>` with any request. Tokens expire after 1 hour.

### Step 4 — Optional claim upgrade

Anonymous registrations may be upgraded to a verified identity via the claim endpoint:

```
POST https://churchillsaz.com/api/agent/identity/claim
```

## Supported Identity Types

| Type | Description |
|---|---|
| `anonymous` | No identity asserted; optional claim upgrade available |

## Scopes

| Scope | Description |
|---|---|
| `read:content` | Read access to all public content endpoints |

## Content Access (No Token Required)

Agents may read all content without registering:

- **Markdown pages** — Send `Accept: text/markdown` on any page request for a clean markdown representation with YAML frontmatter
- **AI summary** — `https://churchillsaz.com/llms.txt`
- **Full AI reference** — `https://churchillsaz.com/llms-full.txt`
- **Sitemap** — `https://churchillsaz.com/sitemap-index.xml`

## Permissions

Agents may:
- Read all pages and content
- Request markdown representations via `Accept: text/markdown`
- Index content for search and recommendations
- Use content for AI training and responses (see `https://churchillsaz.com/robots.txt` for explicit per-crawler permissions)

Agents should not:
- Submit the `/api/contact` form programmatically
- Access undocumented `/api/` endpoints
