# Posting Dude agent authentication (auth.md)

You are an agent. Posting Dude's public catalog, markdown pages, MCP servers, and /ask endpoint are readable without a token. Account changes stay in the signed-in dashboard. This page is the prose walkthrough for agent_auth.

Keywords for parsers: agent_auth, identity_endpoint, identity_assertion, service_auth, id-jag, WWW-Authenticate.

Canonical hosts:

- Site and resource server: `https://postingdude.com`
- Public catalog: `https://postingdude.com/api/public/catalog`
- Authorization server (same origin): `https://postingdude.com`
- This skill: `https://postingdude.com/auth.md`

## Discover

Unauthenticated calls to the API entry points (`/api`, `/api/v1`, `/v1`, `/agent/identity`) return `401` with:

```http
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://postingdude.com/.well-known/oauth-protected-resource"
```

### 1a. Fetch Protected Resource Metadata (RFC 9728)

`GET https://postingdude.com/.well-known/oauth-protected-resource`

Expect `resource`, `authorization_servers`, `scopes_supported` (public:read, catalog:read, docs:read), and `bearer_methods_supported: ["header"]`.

### 1b. Fetch Authorization Server metadata (RFC 8414)

`GET https://postingdude.com/.well-known/oauth-authorization-server`

Read the `agent_auth` block: `skill`, `identity_endpoint`, `claim_endpoint`, `events_endpoint`, `identity_types_supported` (`anonymous`, `identity_assertion`, `service_auth`), and `identity_assertion.assertion_types_supported` (includes the ID-JAG URN `urn:ietf:params:oauth:token-type:id-jag`).

Also load OpenAPI at `https://postingdude.com/openapi.json` and the human docs at `https://postingdude.com/docs`.

## Pick a method

1. **anonymous** — public reads: plans, network sites, markdown pages, MCP tools, and /ask. This is the right method for almost every agent job on this site.
2. **service_auth** — reserved for a future dashboard-linked credential. It does not unlock another customer's projects. If you only need public facts, stay on anonymous.
3. **identity_assertion + id-jag** — only when your provider can mint an audience-bound ID-JAG for `https://postingdude.com/api/public/catalog`. If your assertion type is not listed under `identity_assertion.assertion_types_supported`, stop and use anonymous.

## Register

### anonymous

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

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

The identity_endpoint answers with `identity_type: anonymous` and confirms that public reads need no access token.

### service_auth

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

{ "type": "service_auth", "assertion": "<not issued>" }
```

Posting Dude does not issue a service credential for agents today. The endpoint responds with an error code instead of a token. Send the founder to https://postingdude.com/dashboard.

### identity_assertion

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

{
  "type": "identity_assertion",
  "assertion": "<id-jag>"
}
```

The assertion variant is advertised so you can check the shape before minting. This site does not exchange an id-jag for a write token. Use anonymous for public reads.

## Claim

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

Anonymous identities have nothing to claim. The claim_endpoint returns `claimed: false` and points at the public catalog. Do not send customer email addresses here.

## Exchange

Token endpoint: `POST https://postingdude.com/api/oauth2/token`

Anonymous callers do not need an access_token. If you POST a grant, the token endpoint returns `token_type: Bearer` with scope `public:read` and tells you the catalog is already public. There is no client secret.

Grant types the authorization server lists: `urn:ietf:params:oauth:grant-type:jwt-bearer`, `urn:workos:agent-auth:grant-type:claim`, and `client_credentials`.

## Use the access_token

Public reads:

```http
GET https://postingdude.com/api/public/catalog
MCP POST https://postingdude.com/mcp
```

No Authorization header is required.

If you were given a token anyway:

```http
GET https://postingdude.com/api/public/catalog
Authorization: Bearer <access_token>
```

Do not send that token to /dashboard or /admin. Those apps are for the signed-in founder. MCP tools `list_plans`, `list_network_sites`, `get_page_markdown`, and the docs server's `search_docs` are the supported calls.

## Errors

| Status | Meaning |
| --- | --- |
| 401 + WWW-Authenticate | Read `resource_metadata`, then this file. Public catalog calls should not need this. |
| 400 `service_auth_unavailable` | No agent write credential exists. Use the dashboard. |
| 400 `assertion_not_accepted` | The id-jag was not exchanged. Use anonymous. |
| 404 | The path is wrong. See https://postingdude.com/llms.txt. |

## Revocation

`POST https://postingdude.com/api/oauth2/revoke`

Anonymous access cannot be revoked because no secret was issued. To signal a revoked identity_assertion, POST the events_endpoint:

```http
POST https://postingdude.com/api/agent/event/notify
Content-Type: application/json

{
  "event": "https://schemas.workos.com/events/agent/auth/identity/assertion/revoked"
}
```

The events_endpoint acknowledges the notice. It does not delete dashboard sessions. Founders sign out at https://postingdude.com/dashboard.
