# Auth.md

> Agent Authentication & Discovery Specification for Qetaatek Automotive ERP (`https://qetaatek.fekralabs.com`)

## Overview
This specification details discovery metadata, agent registration, authentication, and credential lifecycle for AI agents interacting with the Qetaatek Automotive ERP platform.

## Discovery Endpoints
- **Protected Resource Metadata (RFC 9728)**: `https://qetaatek.fekralabs.com/.well-known/oauth-protected-resource`
- **OAuth Authorization Server (RFC 8414)**: `https://qetaatek.fekralabs.com/.well-known/oauth-authorization-server`
- **OpenID Connect Discovery**: `https://qetaatek.fekralabs.com/.well-known/openid-configuration`
- **MCP Server Card (SEP-1649)**: `https://qetaatek.fekralabs.com/.well-known/mcp/server-card.json`
- **Agent Skills Discovery**: `https://qetaatek.fekralabs.com/.well-known/agent-skills/index.json`
- **AI Resource Catalog (ARD)**: `https://qetaatek.fekralabs.com/.well-known/ai-catalog.json`
- **API Catalog (RFC 9727)**: `https://qetaatek.fekralabs.com/.well-known/api-catalog`

## Agent Registration
Autonomous AI agents can register and obtain programmatic access credentials:

```http
POST https://fekralabs.com/api/agent/register
Content-Type: application/json

{
  "agent_name": "AutonomousPartsAgent",
  "identity_type": "verified_email",
  "client_uri": "https://agent-domain.example",
  "redirect_uris": ["https://agent-domain.example/callback"],
  "grant_types": ["client_credentials", "refresh_token"],
  "scope": "agent:read agent:write"
}
```

## Supported Credentials & Identity Types
- **Bearer Tokens**: Standard OAuth 2.0 Bearer tokens in HTTP `Authorization: Bearer <token>` header.
- **API Key**: `X-Agent-Key: <key>` header for direct server-to-server MCP tool access.
- **Identity Assertion**: `urn:ietf:params:oauth:token-type:id-jag` or verified email signatures.

## Revocation & Claims
- **Revocation Endpoint**: `https://fekralabs.com/api/agent/revoke`
- **Claim Endpoint**: `https://fekralabs.com/api/agent/claim`

## Scopes
- `agent:read`: Query spare parts catalogs, OEM cross references, and VIN specifications.
- `agent:write`: Submit quote requests, contact tickets, and test license registrations.
- `agent:register`: Dynamic client registration and token rotation.

## Contact
- Developer: Fekra Labs Software Solutions
- Email: info@fekralabs.com
- WhatsApp: +201016525905
