사용자 지정 커넥터의 다중 인증

다중 인증(multi-auth)은 사용자를 하나의 인증 유형으로 제한하지 않고 사용자가 연결을 생성하는 데 사용할 인증 방법을 선택할 수 있는 옵션을 제공하는 기능입니다.

커넥터의 경우 apiProperties.json 파일의 connectionParameterSets로 인증 유형의 컬렉션이 정의됩니다.

중요

사용자 지정 커넥터 마법사에서 사용자 지정 커넥터에 여러 인증을 사용하도록 설정하는 기능은 아직 지원되지 않습니다. 다중 인증으로 사용자 지정 커넥터를 만들려면 대신 Microsoft Power Platform 커넥터 CLI를 사용합니다.

다중 인증을 활성화하는 방법

apiProperties.json 파일에 connectionParameterSets를 추가하고 커넥터에 필요한 만큼 connectionParameters로 컬렉션 connectionParameterSets.values를 채웁니다.

참고

연결 매개 변수 및 인증 유형에 대한 자세한 내용은 연결 매개 변수를 참조하세요.

다음은 connectionParameterSets의 구조입니다.

"connectionParameterSets": {
  // uiDefinition for the parameter sets.
  "uiDefinition": {
    "displayname": "Select the authorization type",
    "description": "<<Enter here your description>>"
  },
  "values": [
    // Connection parameter set
    {
      "name": "<parameter set name>",
      // uiDefinition for this parameter set.
      "uiDefinition": {
        "displayname": "<display name>",
        "description": "<description text>"
      },
      "parameters": {
        // Schema matches existing "connectionParameters"
        "<parameter name>": {
          "type": "string | securestring | oauthsetting"
        },
        "<parameter name>:clientId": {
          "type": "string",
          "uiDefinition": {
            "schema": {
              // For string types, the description must be placed in
              // uiDefinition.schema.description to be shown in the description box
              "type": "string",
              "description": "<description text>"
            },
            "displayName": "<display name>",
          }
        }
      }
    },
    {
      "name": "<parameter set name 2>"
      // ...
    }
  ]
}

API 키 및 기본 인증으로 구성

"connectionParameterSets": {
    "uiDefinition": {
        "displayName": "Authentication Type",
        "description": "Type of authentication to be used."
    },
    "values": [
        {
            "name": "basic-auth",
            "uiDefinition": {
                "displayName": "Use your X credentials",
                "description": "Log in using your username and password for X."
            },
            "parameters": {
                "username": {
                    "type": "string",
                    "uiDefinition": {
                        "displayName": "X username",
                        "schema":{
                            "description": "The username for X",
                            "type": "string"
                        },
                        "tooltip": "Provide your X username",
                        "constraints": {
                            "required": "true"
                        }
                    }
                },
                "password": {
                    "type": "securestring",
                    "uiDefinition": {
                        "displayName": "X password",
                        "schema":{
                            "description": "The password for X",
                            "type": "securestring"
                        },
                        "tooltip": "Provide your X password",
                        "constraints": {
                            "required": "true"
                        }
                    }
                }
            }
        },
        {
            "name": "api-auth",
            "uiDefinition": {
                "displayName": "Use X API Key",
                "description": "Log in using X's API Key."
            },
            "parameters": {
                "api_key": {
                    "type": "securestring",
                    "uiDefinition": {
                        "constraints": {
                            "clearText": false,
                            "required": "true",
                            "tabIndex": 3
                        },
                        "schema":{
                            "description": "Enter your API Key for X",
                            "type": "securestring"
                        },
                        "displayName": "API Key generated in X"
                    }
                },
                "environment": {
                    "type": "string",
                    "uiDefinition": {
                        "displayName": "Environment",
                        "schema":{
                            "description": "The API environment to use; either production or sandbox",
                            "type": "string"
                        },
                        "tooltip": "Select an API environment to use",
                        "constraints": {
                            "required": "true",
                            "allowedValues": [
                                {
                                    "text": "Sandbox",
                                    "value": "YOUR_SANDBOX_VALUE_HERE"
                                },
                                {
                                    "text": "Production",
                                    "value": "YOUR_PROD_VALUE_HERE"
                                }
                            ]
                        }
                    }
                }
            }
        }
    ]
}

AAD 및 OAUTH 2.0으로 구성

동일한 유형의 connectionParameters 2개를 가질 수 있습니다. 이 경우 두 권한 부여에 모두 oauthSetting 유형이 사용되며, 하나는 사용자가 AAD로 연결을 만들고 다른 하나는 사용자 지정 엔드포인트를 사용합니다.

"connectionParameterSets": {
    "uiDefinition": {
        "displayName": "Authentication Type",
        "description": "Type of authentication to be used."
    },
    "values": [
        {
            "name": "aad-auth",
            "uiDefinition": {
                "displayName": "Use default shared application",
                "description": "Log in using the standard X app."
            },
            "parameters": {
                "token": {
                    "oAuthSettings": {
                        "clientId": "YOUR_AAD_APPLICATION_ID_HERE",
                        "customParameters": {
                            "loginUri": {
                                "value": "https://login.windows.net"
                            },
                            "resourceUri": {
                                "value": "https://graph.microsoft.com"
                            },
                            "tenantId": {
                                "value": "common"
                            }
                        },
                        "identityProvider": "aad",
                        "properties": {
                            "IsFirstParty": "False"
                        },
                        "redirectMode": "GlobalPerConnector",
                        "scopes": [
                            "Group.ReadWrite.All offline_access"
                        ]
                    },
                    "type": "oauthSetting"
                }
            }
        },
        {
            "name": "custom-app-auth",
            "uiDefinition": {
                "displayName": "Use the X authentication app",
                "description": "Log in using X app."
            },
            "parameters": {
                "token": {
                    "type": "oauthSetting",
                    "oAuthSettings": {
                        "clientId": "YOUR_CLIENT_ID_HERE",
                        "identityProvider": "oauth2",
                        "redirectMode": "GlobalPerConnector",
                        "customParameters": {
                            "authorizationUrl": {
                                "value": "https://login.dummy.net/request"
                            },
                            "refreshUrl": {
                                "value": "https://login.dummy.net/token"
                            },
                            "tokenUrl": {
                                "value": "https://login.dummy.net/token"
                            }
                        }
                    }
                }
            }
        }
    ]
}

다중 인증을 구현하는 방법에 대한 현재의 예를 보려면 여기에서 RescoCloud 커넥터를 참조하세요.