# Auth.md

## AI Agent Registration & Authentication

This document details the authentication and autonomous registration endpoints for AI agents accessing `sanjayshankar.me`.

---

### 1. Discovery
The protected resource metadata and authorization server metadata can be discovered at:
- Protected Resource Metadata: `https://sanjayshankar.me/.well-known/oauth-protected-resource`
- Authorization Server Metadata: `https://sanjayshankar.me/.well-known/oauth-authorization-server`

### 2. Registration Flow
AI agents can register for API access autonomously.
- **Registration URI**: `https://sanjayshankar.me/wp-json/agent/v1/register`
- **Supported Identity Types**: `anonymous`
- **Supported Credential Types**: `api_key`

To register, perform a `POST` request to the registration URI:
```json
POST /wp-json/agent/v1/register
Content-Type: application/json

{
  "identity_type": "anonymous"
}
```

### 3. Scopes
The following scopes are supported:
- `read`: Read public posts, pages, portfolios, and services content.
- `write`: Post contact form messages and submit project inquiries.

### 4. Credential Use
Once registered, agents must include their obtained credential in the HTTP request headers:
```http
Authorization: Bearer YOUR_API_KEY
```
