# Siena auth.md

How an AI agent gets access to Siena Society (sienasociety.com) for a person. Siena runs friendship dinners in London: on Thursday evenings at 7:30pm it seats a small table of strangers who want to make friends at a London restaurant.

## 1. Agent registration

Siena does not support agent self-registration. There is no endpoint where an agent creates an account or claims an identity, and the authorization server metadata has no `agent_auth` block. A person creates their Siena account on sienasociety.com, and the agent then acts for that person with a credential they approve. The agent registers itself as an OAuth client (section 5), which gives it no access on its own.

## 2. The person signs up

- Sign up: https://sienasociety.com/signup (email, or Google).
- Sign in: https://sienasociety.com/signin
- The person answers a few questions about themselves when they sign up. An agent cannot do these steps for them.

Without an account, an agent can still call the public MCP tools (`list_cities`, `list_upcoming_dinners`, `get_dinner`, `how_it_works`, `start_booking`, `search_site`, `get_page`). They need no credential. `start_booking` returns the booking link. Give it to the person, who signs up and books on sienasociety.com.

## 3. What needs a credential

- Without a credential: the public MCP tools `list_cities`, `list_upcoming_dinners`, `get_dinner`, `how_it_works`, `start_booking`, `search_site` and `get_page`, every public page (also as Markdown with `Accept: text/markdown`), and https://sienasociety.com/llms.txt.
- With a credential: `list_my_bookings`, the person's own bookings and dinner credits. Scope `bookings:read`.
- Nothing an agent can call books, cancels or pays. `start_booking` returns a link, and the person books and pays on sienasociety.com at the same price as always.

## 4. Discover

- An MCP call to `list_my_bookings` without a credential gets HTTP 401 with `WWW-Authenticate: Bearer resource_metadata="https://sienasociety.com/.well-known/oauth-protected-resource/mcp", scope="bookings:read"`.
- Protected resource metadata (RFC 9728): https://sienasociety.com/.well-known/oauth-protected-resource/mcp for the MCP endpoint, and https://sienasociety.com/.well-known/oauth-protected-resource for the site root.
- Authorization server metadata (RFC 8414): https://sienasociety.com/.well-known/oauth-authorization-server. The issuer is `https://sienasociety.com`.
- MCP server card: https://sienasociety.com/.well-known/mcp/server-card.json
- API catalog (RFC 9727): https://sienasociety.com/.well-known/api-catalog

## 5. Connect with OAuth 2.1 (MCP)

- **Registration endpoint**: https://sienasociety.com/oauth/register (POST, RFC 7591)
- **Authorization server**: https://sienasociety.com
- **Authorization endpoint**: https://sienasociety.com/oauth/authorize
- **Token endpoint**: https://sienasociety.com/oauth/token
- **OAuth flow**: Authorization Code + PKCE (`S256` required)
- **Credential type**: Bearer token in the `Authorization` header

- MCP endpoint: https://sienasociety.com/mcp (Streamable HTTP, JSON-RPC 2.0 in a POST).
- Client registration, one of:
  - Dynamic client registration (RFC 7591): POST https://sienasociety.com/oauth/register.
- Send a JSON body such as `{"client_name": "My agent", "redirect_uris": ["http://127.0.0.1:33418/callback"]}`. The answer carries your `client_id`. Public clients only (`token_endpoint_auth_method` `none`). Redirect URIs must be https, http on localhost, or the app's own scheme.
- Authorization code flow with PKCE (`S256` only) at https://sienasociety.com/oauth/authorize. The person signs in to Siena and approves on a consent screen. Only members who finished signing up can approve.
- Token endpoint: https://sienasociety.com/oauth/token. Revocation: https://sienasociety.com/oauth/revoke. Signing keys: https://sienasociety.com/oauth/jwks.
- Send `resource=https://sienasociety.com/mcp` (RFC 8707).
- Scopes: `bookings:read` (the person's own bookings and dinner credits).
- Access tokens are ES256 JWTs (they start with `eyJ`) and last 15 minutes. Refresh tokens start with `sr_`, last 30 days and rotate on each use. A refresh token used twice ends the whole connection.
- The token works as the person who approved it, and `list_my_bookings` opens up.
- Credential type: an OAuth 2.1 access token, with a refresh token. Siena issues no API keys and no client secrets.
- Send it as `Authorization: Bearer <token>`. Never write it to a file or a log.

## 6. Errors

- MCP: 401 with `WWW-Authenticate` when the credential is missing, and `error="invalid_token"` when it is bad, expired or revoked.
- OAuth endpoints: RFC 6749 errors (`error`, `error_description`). Too many calls from one address get 429.

## 7. Revocation

- The client revokes a connection at https://sienasociety.com/oauth/revoke.
- The person can disconnect an app themselves on https://sienasociety.com/app/profile, under Connected apps. That app's tokens stop working within a minute.
- Or they write to hi@sienasociety.com, and Siena removes every connected app. Every token stops working within a minute.

## More

- llms.txt: https://sienasociety.com/llms.txt
- Agent skills: https://sienasociety.com/.well-known/agent-skills/index.json
- Terms: https://sienasociety.com/terms. Privacy: https://sienasociety.com/privacy.
