> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bridger.kr/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Bridger Gateway 인증 — API Key 헤더, 에러 응답, 테넌트 식별.

Bridger Gateway는 두 가지 인증 헤더를 받습니다. 둘 중 하나만 보내면 됩니다.

```http theme={null}
x-api-key: dk_live_xxx
Authorization: Bearer dk_live_xxx
```

## API Key 발급

[admin.datari.kr](https://admin.datari.kr) → **Settings → API Keys**에서 발급/회수합니다.
자세한 흐름은 [API 키 가이드](/guides/api-keys)를 참고하세요.

## 인증 실패 응답

키가 없거나 잘못된 경우 **401 Unauthorized**가 반환됩니다.

```json theme={null}
{
  "error": "Unauthorized",
  "message": "Valid API key is required."
}
```

## 테넌트 식별

테넌트는 **API Key로만** 식별됩니다. 조직 단위로 발급된 키는 해당 조직의 테넌트에
자동으로 연결됩니다.

<Warning>
  클라이언트가 보내는 `x-tenant-id`·`x-user-id` 헤더는 소유권 위조(spoofing)를 막기 위해
  Gateway에서 **무시·제거**됩니다. 테넌트는 인증된 API Key로만 결정됩니다.
</Warning>

## OAuth 2.0

조직 단위 권한 관리·SSO 연동이 필요한 경우 OAuth 2.0 Authorization Code 또는
Client Credentials 흐름을 사용합니다.

<Note>
  OAuth 클라이언트 등록은 현재 베타이며, [admin.datari.kr](https://admin.datari.kr)에서
  요청할 수 있습니다. 발급 후 access token을 동일하게 `Authorization: Bearer ...` 헤더로 전달하면 됩니다.
</Note>

## cURL 예시

```bash theme={null}
curl -X POST https://mcp.datari.kr/mcp \
  -H "x-api-key: $DATA_BRIDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```
