# FintechToolkit auth.md — AI Agent Registration and Access

Welcome to FintechToolkit. This document describes how autonomous AI agents, chatbots, and programmatic systems can discover, register, authenticate, and query the directory.

## Identity & Discovery Standards
- **OAuth Protected Resource Metadata:** [/.well-known/oauth-protected-resource](https://fintechtoolkit.com/.well-known/oauth-protected-resource)
- **OAuth Authorization Server:** [/.well-known/oauth-authorization-server](https://fintechtoolkit.com/.well-known/oauth-authorization-server)
- **OpenID Configuration:** [/.well-known/openid-configuration](https://fintechtoolkit.com/.well-known/openid-configuration)
- **API Catalog (RFC 9727):** [/.well-known/api-catalog](https://fintechtoolkit.com/.well-known/api-catalog)

## Agent Registration
AI agents can register automatically to acquire scoped API access credentials.

- **Registration Endpoint:** `POST https://fintechtoolkit.com/api/agent/register`
- **Claim Endpoint:** `POST https://fintechtoolkit.com/api/agent/claim`
- **Revocation Endpoint:** `POST https://fintechtoolkit.com/api/agent/revoke`

### Supported Identity Types
1. **Identity Assertion (`identity_assertion`):**
   - Assertion Types: `urn:ietf:params:oauth:token-type:id-jag`, `verified_email`
   - Scopes: `read:tools`, `search`, `read:categories`
2. **Anonymous (`anonymous`):**
   - Credential Types: `bearer_token`
   - Rate Limits: 60 requests/minute

### Request Example
```http
POST /api/agent/register HTTP/1.1
Host: fintechtoolkit.com
Content-Type: application/json

{
  "client_name": "MyFintechAgent",
  "identity_type": "anonymous",
  "redirect_uris": []
}
```

### Response
```json
{
  "client_id": "agent_anon_...",
  "access_token": "ftk_agent_...",
  "token_type": "Bearer",
  "expires_in": 86400,
  "scope": "read:tools search"
}
```

## Using Credentials
Include the Bearer token in subsequent HTTP requests:
```http
GET /api/search?q=payments HTTP/1.1
Host: fintechtoolkit.com
Authorization: Bearer ftk_agent_...
```
