# auth.md

Track My Subscriptions publishes a public price catalog. Reading it does not require an account. An optional OAuth 2.0 client-credentials token can request the single scope `catalog:read`.

## Discover

- Authorization server metadata: https://www.trackmysubscriptions.com/.well-known/oauth-authorization-server
- Protected resource metadata: https://www.trackmysubscriptions.com/.well-known/oauth-protected-resource
- OpenAPI: https://www.trackmysubscriptions.com/openapi.json

The protected resource is https://www.trackmysubscriptions.com/api/catalog. Its only scope is `catalog:read`.

## Read without a token

These requests succeed with no Authorization header:

- `GET https://www.trackmysubscriptions.com/api/catalog/services?q={query}`
- `GET https://www.trackmysubscriptions.com/api/catalog/services/%7Bslug%7D`
- `POST https://www.trackmysubscriptions.com/mcp` with `search_subscriptions` and `get_subscription`

## Request a token

The public client id is `catalog`. There is no client secret. The only grant is `client_credentials`, and the only scope is `catalog:read`.

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

grant_type=client_credentials&client_id=catalog&scope=catalog:read
```

The response is JSON with `access_token`, `token_type` (`Bearer`), `expires_in`, and `scope`.

## Use the access token

Send `Authorization: Bearer {access_token}` on catalog reads. The token cannot open account pages, CSV export, calendar feeds, or billing. People still sign in in a browser, with Google or a magic link, and that session stays an HTTP-only cookie.

If you send a token, it must be valid. Omit the header to read the catalog anonymously. A rejected token is `application/problem+json` with `code`, `message`, and `hint`, plus a `WWW-Authenticate` challenge that points at the protected-resource metadata.

## Errors

Token requests that fail use an OAuth error string and `error_description`:

- `invalid_client` — use `client_id=catalog`
- `invalid_scope` — request only `catalog:read`
- `unsupported_grant_type` — use `client_credentials`

Unknown API paths return `application/problem+json` with `code`, `message`, and `hint`. Start from https://www.trackmysubscriptions.com/openapi.json.

## Support

Email kalash@trackmysubscriptions.com or kalashvasaniya@gmail.com.
