# auth.md — tokwords.com

## Audience

AI agents acting for a person who wants to read the spoken text of a public TikTok video, or to read
this site's four pages on that person's behalf.

## Registering an agent

Registration is self-service and anonymous. There is no account, no email confirmation and no secret
issued to the client.

- register_uri: https://tokwords.com/api/agent/register
- method: POST, Content-Type: application/json
- body: {"agent_name": "<your agent name>", "contact": "<optional operator email>"}
- response: {"client_id": "...", "scope": "transcribe", "token_endpoint": "https://tokwords.com/api/agent/token", "auth_method": "none", "expires_in": 3600}

Probe the registration endpoint only when a person asks you to use it; a passive scan never needs to
create anything, because the endpoint needs no credentials to call.

## Getting a token

POST https://tokwords.com/api/agent/token
Content-Type: application/json
Body: {"grant_type": "client_credentials", "client_id": "<client_id from registration>"}

Response: {"access_token": "...", "token_type": "Bearer", "expires_in": 3600, "scope": "transcribe"}

The token is optional. Its only effect is a per-client label in the server's request accounting; the
transcript endpoint accepts anonymous calls. Never present the token as proof of identity: it is not
signed by an identity provider and asserts nothing about the person you act for.

## agent_auth

```yaml
agent_auth:
  skill: tiktok-transcript
  register_uri: https://tokwords.com/api/agent/register
  methods:
    - type: anonymous
      credential_types_supported: ["none"]
```

## Authorization server metadata

- OpenID Connect discovery: https://tokwords.com/.well-known/openid-configuration
- OAuth 2.0 authorization server metadata: https://tokwords.com/.well-known/oauth-authorization-server
- Protected resource metadata: https://tokwords.com/.well-known/oauth-protected-resource
- Signing keys: https://tokwords.com/.well-known/jwks.json (RS256, public key only)

## Using credentials

- Send the token as `Authorization: Bearer <token>` if you use one. A missing or expired token never
  blocks a public read.
- Do not send a token to any other host, and do not put it in a URL.
- tokwords.com has no user accounts, no login for people and no administrative API. There is nothing
  to escalate to.

## Contact

helloxtony@gmail.com — see https://tokwords.com/contact
