다음을 통해 공유


GraphConnectorNotificationPlugin

TAC(Teams 관리 Center)에서 Microsoft Graph 커넥터를 사용하거나 사용하지 않도록 설정할 때 알림을 시뮬레이션합니다. 외부 연결을 만들고 삭제하기 위한 요청의 유효성을 검사합니다.

구성된 알림 요청을 실행하려면 Dev Proxy가 실행 중인 명령 프롬프트 세션을 누릅니 w 다.

명령 프롬프트가 두 으로 분할된 스크린샷 가장 중요한 부분은 개발자 프록시가 시뮬레이션된 Teams 관리 Center 알림을 실행하는 것을 보여  주는 것입니다. 아래쪽 부분에는 알림을 받는 Microsoft Graph 커넥터가 표시됩니다.

알림 요청 발급

GraphConnectorNotificationPlugin 추가 기능을 사용하여 를 확장 MockRequestPlugins 하여 TAC의 알림을 시뮬레이션합니다.

토큰 설명
@dynamic.validationToken 알림의 신뢰성을 확인하기 위한 JWT 토큰입니다. 개발자 프록시는 인증서로 서명된 유효한 JWT 토큰으로 Dev Proxy CA 바꿉니다.

알림 처리 및 Graph 커넥터 요청 발급 유효성 검사

알림 요청 시뮬레이트 옆에 있는 는 GraphConnectorNotificationPlugin 알림 API가 알림을 올바르게 처리하고 올바른 Microsoft Graph 요청을 발급하는지 유효성을 검사합니다.

TAC 알림을 처리하기 위해 플러그 인은 API가 본문 없이 202 수락 응답을 보내는지 확인합니다. 또한 플러그 인은 Microsoft Graph 엔드포인트에 /external/connections/* 대한 POST 및 DELETE 요청을 검사합니다. 요청에 알림에 지정된 티켓이 GraphConnectors-Ticket 있는 헤더가 포함되어 있는지 확인합니다. 검사 중 하나가 실패하면 플러그 인에서 오류를 기록합니다.

플러그 인 instance 정의

{
  "name": "GraphConnectorNotificationPlugin",
  "enabled": true,
  "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
  "configSection": "graphConnectorNotificationEnabled"
}

구성 예

{
  "graphConnectorNotificationEnabled": {
    "mockFile": "graph-connector-notification-enabled.json",
    "tenant": "fa15d692-e9c7-4460-a743-29f29522229",
    "audience": "ef1da9d4-ff77-4c3e-a005-840c3f830745"
  }
}

구성 속성

속성 Description 기본값 필수
audience Microsoft Graph 커넥터가 알림 요청을 인증하는 데 사용하는 Microsoft Entra 앱 등록 ID 비어 있음 Yes
mockFile 모의 요청이 포함된 파일의 경로 mock-request.json Yes
tenant Microsoft Graph 커넥터가 외부 연결을 만드는 테넌트 ID 비어 있음 Yes

명령줄 옵션

없음

모의 요청 파일 예제

다음은 고객에 대한 정보를 위해 CRUD API를 정의하는 API 파일의 몇 가지 예입니다.

Microsoft Graph 커넥터 TAC 알림 사용

다음은 사용자가 Microsoft Graph 커넥터를 사용하도록 설정할 때 Teams 관리 Center에서 보내는 알림의 예입니다.

{
  "$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.16.0/mockrequestplugin.schema.json",
  "request": {
    "url": "http://localhost:3000/api/notification",
    "method": "POST",
    "body": {
      "value": [
        {
          "changeType": "updated",
          "subscriptionId": "79f3b611-7f15-4bdd-9422-9606a24e49f3",
          "resource": "external",
          "clientState": null,
          "resourceData": {
            "@odata.type": "#Microsoft.Graph.connector",
            "@odata.id": "external",
            "id": "35177924-33fc-444d-bd51-f059ce385ec2",
            "state": "enabled",
            "connectorsTicket":"eyJhbGciOiJIUzI1"
          },
          "subscriptionExpirationDateTime": "2021-06-26T12:40:26.4436785-07:00",
          "tenantId": "fa15d692-e9c7-4460-a743-29f29522229"
        }
      ],
      "validationTokens": [ "@dynamic.validationToken" ]
    }
  }
}