본문으로 건너뛰기

표준 · 위임

위임 및 CIBA

사람을 대신하는 앱·에이전트를 위한 세 표준: 더 좁은 토큰을 다른 서비스나 에이전트에 넘기는 토큰 교환(RFC 8693), 넓은 스코프 대신 구체적 요청을 하는 풍부한 권한 부여 요청(RFC 9396), 본인 기기에서 승인을 요청하는 CIBA(OpenID Connect Client-Initiated Backchannel Authentication).

각 기능은 환경별 옵트인: 개발자 콘솔에서 앱을 열고 환경을 선택한 뒤 Delegation 카드를 사용합니다. 기밀(서버측) 환경만 가능. 이 Identvia 서버 운영자가 기능을 끌 수 있으며 https://id.identvia.com/.well-known/openid-configuration 디스커버리가 항상 켜진 항목을 알립니다.

토큰 교환(RFC 8693)

보유한 액세스 토큰을 더 짧고 좁으며 선택적으로 사람을 대신하는 에이전트를 지칭하는 새 토큰으로 바꾸세요.

HTTP
POST /oauth/token
Authorization: Basic base64(client_id:client_secret)
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token=<access token issued to you>
&subject_token_type=urn:ietf:params:oauth:token-type:access_token
&audience=<another Identvia client_id, or the MCP resource>
&scope=openid email
&actor_token=<agent JWT, optional>
&actor_token_type=urn:ietf:params:oauth:token-type:jwt

규칙

  • subject 토큰은 당신에게 발급된 Identvia 액세스 토큰이거나 aud가 당신을 지칭하는 것이어야 합니다. 원본 앱과의 연결이 활성이어야 합니다.
  • 스코프는 줄어들 수만 있습니다. scope를 보내지 않으면 원본에서 offline_access를 뺀 값입니다. offline_access는 교환되지 않으며 리프레시/ID 토큰도 발급되지 않습니다.
  • audience(또는 resource)는 활성 Identvia 클라이언트 또는 Identvia MCP 리소스여야 합니다. 그 외는 invalid_target. audience가 다른 클라이언트면 sub는 해당 클라이언트용 pairwise 식별자입니다.
  • 새 토큰은 최대 10분 살며 원본보다 길 수 없습니다. 체인은 3홉으로 제한됩니다.
  • 원본 토큰 취소 또는 상대의 앱 연결 해제는 파생 토큰을 즉시 끕니다(인트로스pection은 active: false).
  • 잘못된 subject 또는 actor 토큰은 RFC 8693 §2.2.2에 따라 invalid_request를 반환합니다.

액터 토큰

에이전트를 지정하려면 actor 토큰을 보내세요: 계정 Agents에 등록한 에이전트 키로 서명한(ES256 또는 RS256) JWT.

JSON
header:  { "alg": "ES256", "kid": "<RFC 7638 JWK thumbprint of the agent key>" }
payload: { "sub": "<harness id shown in the person's Agents page>",
           "aud": "https://id.identvia.com",
           "iat": 1700000000, "exp": 1700000120,
           "jti": "<unique, single use>" }

토큰은 5분 내 만료, 각 jti는 한 번, 차단된 에이전트는 거부. 발급 토큰은 표준 act 클레임을 가지며 이전 액터는 그 안에 중첩됩니다:

JSON
{ "sub": "…", "aud": "oid_…", "scope": "openid email",
  "act": { "sub": "harness-123", "agent_tier": "registered",
           "act": { "sub": "oid_first_app" } } }

RFC 8693 §4.1에 따라 접근 결정은 최상위 클레임과 현재 액터에만 기반하세요. 중첩 액터는 이력입니다.

풍부한 권한 부여 요청(RFC 9396)

권한 부여 요청과 함께 authorization_details(JSON 배열)를 보냅니다. 이 서버에서 허용하는 유형: agent_task.

JSON
[{ "type": "agent_task",
   "actions": ["read", "summarize"],
   "locations": ["https://api.example.com/inbox"],
   "datatypes": ["messages"],
   "identifier": "folder-42" }]
  • 이전에 앱을 신뢰했어도 동의 화면에는 항상 구체적 요청이 보입니다.
  • 공통 필드 locations, actions, datatypes, privileges는 문자열 배열이어야 하고 identifier는 문자열입니다. 최대 10개, 4KB.
  • 부여된 세부 정보는 토큰 응답, 액세스 토큰의 authorization_details 클레임, 인트로스pection, 새로고침 후에 돌아옵니다.
  • 오류는 invalid_authorization_details를 사용합니다.
  • 토큰 교환은 세부 정보를 상속하거나 좁힐 수 있으며, 넓히거나 새로 추가할 수 없습니다.

CIBA: 본인 기기에서 승인

콜센터, 키오스크, 상대를 알지만 브라우저 세션이 없는 백오피스 에이전트용. Delegation 카드에서 Poll 또는 Ping을 선택하세요.

HTTP
POST /oauth/bc-authorize
Authorization: Basic base64(client_id:client_secret)

scope=openid email
&login_hint=person@example.com
&binding_message=Desk 4 · code 7Q2K
&requested_expiry=120

→ 200 { "auth_req_id": "…", "expires_in": 120, "interval": 5 }
  • login_hint는 이메일 주소여야 합니다. id_token_hint, login_hint_token, 서명된 요청(request), user_code는 지원되지 않으며 invalid_request를 반환합니다.
  • 이메일이 누군가의 것인지와 관계없이 응답이 같아 계정 탐색에 쓸 수 없습니다. 모르는 사람은 그냥 승인하지 않습니다.
  • 화면에 같은 binding_message를 표시하세요. 사용자는 Identvia 받은편지함과 이메일에서 앱이 보낸 메시지로 표시된 것을 보고 일치하는지 확인합니다. 최대 48자: 문자, 숫자, 공백, 기본 문장 부호(- _ . , : # ( ) · !). 링크, 도메인 이름, 이메일 주소는 invalid_binding_message로 거부됩니다. 한 사람은 모든 앱을 합쳐 시간당 몇 건의 요청만 받습니다.
  • 상대는 받은편지함 링크가 있는 이메일을 받으며 승인 링크는 없습니다. 승인에는 새 패스키 또는 인증 앱 확인이 필요합니다.

Poll 모드

HTTP
POST /oauth/token
grant_type=urn:openid:params:grant-type:ciba&auth_req_id=…

→ 400 authorization_pending | slow_down | access_denied | expired_token
→ 200 { "access_token": "…", "id_token": "…", "refresh_token": "…" }

폴링 간격은 최소 interval초. 너무 빠르면 slow_down과 간격 +5초. auth_req_id는 한 번만 상환됩니다.

Ping 모드

앱 자체 도메인에 https 알림 엔드포인트를 등록하고 요청마다 client_notification_token을 보냅니다. 상대가 결정하면 Identvia가 {"auth_req_id": "…"}를 Authorization: Bearer <your client_notification_token>와 함께 POST합니다. 토큰을 확인하고 204로 응답한 뒤 poll처럼 토큰 엔드포인트를 호출하세요. push 모드는 제공하지 않습니다.

PHP SDK

PHP
// 토큰 교환: 다른 앱을 위한 더 좁은 토큰, 선택적으로 에이전트 이름
$t = $identvia->tokenExchange($accessToken, audience: 'oid_other_app', scope: 'openid email', actorToken: $agentJwt);
$t->accessToken;              // 리프레시 토큰 없음, 단기

// CIBA(poll)
$req = $identvia->cibaAuthorize('person@example.com', scope: 'email', bindingMessage: 'Desk 4 · 7Q2K');
$interval = $req['interval'];
while (($tokens = $identvia->cibaPoll($req['auth_req_id'], $interval)) === null) { sleep($interval); }
// throws TokenException with error access_denied or expired_token when it's over

// CIBA(ping): 알림 엔드포인트에서
$id = Identvia\Sdk\Identvia::verifyCibaPing($_SERVER['HTTP_AUTHORIZATION'] ?? '', file_get_contents('php://input'), $storedToken);

// 로그인 시 풍부한 권한 부여 요청
$identvia->redirectToSignIn(['authorization_details' => [['type' => 'agent_task', 'actions' => ['read']]]]);

디스커버리

켜지면 디스커버리가 grant_types_supported에 urn:ietf:params:oauth:grant-type:token-exchange와 urn:openid:params:grant-type:ciba, 그리고 authorization_details_types_supported, backchannel_authentication_endpoint, backchannel_token_delivery_modes_supported, backchannel_user_code_parameter_supported: false를 나열합니다.

어떤 IETF 에이전트 신원 초안을 얼마나 따르는지 다운로드의 docs/standards.md에 있습니다.