# Agent Authentication and Registration (Auth.md)
# Surokkha Medical Center Ltd.

Welcome to the AI Agent Authentication guide for **Surokkha Medical Center Ltd.** This document provides guidance for autonomous AI agents and automated services seeking programmatically authenticated access to Surokkha diagnostic and healthcare APIs.

---

## 1. Overview & Discovery Metadata

Surokkha Medical Center supports standardized OAuth 2.0 and OpenID Connect (OIDC) authentication mechanisms for AI agents.

- **OAuth Authorization Server Metadata:** [`/.well-known/oauth-authorization-server`](file:///.well-known/oauth-authorization-server)
- **OpenID Connect Discovery:** [`/.well-known/openid-configuration`](file:///.well-known/openid-configuration)
- **OAuth Protected Resource Metadata:** [`/.well-known/oauth-protected-resource`](file:///.well-known/oauth-protected-resource)

---

## 2. Dynamic Agent Registration

Autonomous AI agents can register programmatically at our agent registration endpoint:

- **Registration Endpoint:** `https://www.surokkha.org/oauth/register-agent`
- **Supported Grant Types:** `client_credentials`, `authorization_code`, `refresh_token`
- **Supported Identity Types:** `agent`, `user-delegated`
- **Supported Credential Types:** `oauth2`, `bearer`

### Example Registration Payload

```json
{
  "client_name": "HealthAssistantAgent/1.0",
  "redirect_uris": ["https://agent.example.com/callback"],
  "grant_types": ["client_credentials"],
  "token_endpoint_auth_method": "client_secret_basic",
  "scope": "medical:read appointments:manage"
}
```

---

## 3. Scopes & Access Control

| Scope | Description |
| :--- | :--- |
| `medical:read` | Read diagnostic catalog, test pricing, and general lab information |
| `medical:write` | Submit digital lab requests or patient intake data |
| `appointments:manage` | Book, reschedule, or cancel diagnostic screening appointments |
| `reports:view` | Retrieve verified lab & radiology report status |

---

## 4. Token Revocation & Claim Management

- **Agent Claim Endpoint:** `https://www.surokkha.org/oauth/agent-claim`
- **Revocation Endpoint:** `https://www.surokkha.org/oauth/agent-revoke`

For support or custom API access requests, contact `info@surokkha.org`.
