@microsoft/teamsfx-core 3.0.5-alpha.e092ea0a6.0 → 3.0.5-alpha.e63f8a3d5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/graphClient.d.ts +8 -4
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/graphClient.js +35 -8
- package/build/client/graphClient.js.map +1 -1
- package/build/client/interfaces/GetGroupResponse.d.ts +6 -0
- package/build/client/interfaces/GetGroupResponse.d.ts.map +1 -0
- package/build/client/interfaces/GetGroupResponse.js +5 -0
- package/build/client/interfaces/GetGroupResponse.js.map +1 -0
- package/build/client/interfaces/GetUserResponse.d.ts +7 -0
- package/build/client/interfaces/GetUserResponse.d.ts.map +1 -0
- package/build/client/interfaces/GetUserResponse.js +5 -0
- package/build/client/interfaces/GetUserResponse.js.map +1 -0
- package/build/common/featureFlags.d.ts +5 -5
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +9 -9
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/permissionInterface.d.ts +6 -0
- package/build/common/permissionInterface.d.ts.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +1 -0
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +0 -1
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/constant/helpLink.d.ts +2 -0
- package/build/component/deps-checker/constant/helpLink.d.ts.map +1 -1
- package/build/component/deps-checker/constant/helpLink.js +3 -1
- package/build/component/deps-checker/constant/helpLink.js.map +1 -1
- package/build/component/deps-checker/internal/funcToolChecker.js +4 -4
- package/build/component/deps-checker/internal/funcToolChecker.js.map +1 -1
- package/build/component/deps-checker/internal/testToolChecker.js +4 -4
- package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
- package/build/component/driver/index.d.ts +19 -20
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +19 -20
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/m365/acquire.d.ts +3 -0
- package/build/component/driver/m365/acquire.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.js +29 -19
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/share/utils.d.ts.map +1 -1
- package/build/component/driver/share/utils.js +12 -10
- package/build/component/driver/share/utils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.js +5 -2
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts +1 -0
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +8 -4
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/util/utils.d.ts.map +1 -1
- package/build/component/driver/util/utils.js +6 -4
- package/build/component/driver/util/utils.js.map +1 -1
- package/build/component/feature/collaboration.d.ts +7 -1
- package/build/component/feature/collaboration.d.ts.map +1 -1
- package/build/component/feature/collaboration.js +84 -1
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
- package/build/component/generator/combinedProject/generator.js +2 -1
- package/build/component/generator/combinedProject/generator.js.map +1 -1
- package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.js +2 -1
- package/build/component/generator/declarativeAgent/generator.js.map +1 -1
- package/build/component/generator/generator.d.ts +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +2 -1
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +1 -0
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/openApiSpec/common.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/common.js +2 -1
- package/build/component/generator/openApiSpec/common.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +132 -98
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/other/ssrTabGenerator.d.ts.map +1 -1
- package/build/component/generator/other/ssrTabGenerator.js +2 -1
- package/build/component/generator/other/ssrTabGenerator.js.map +1 -1
- package/build/component/generator/other/tdpGenerator.d.ts.map +1 -1
- package/build/component/generator/other/tdpGenerator.js +2 -1
- package/build/component/generator/other/tdpGenerator.js.map +1 -1
- package/build/component/generator/templates/metadata/agentForTeams.js +30 -30
- package/build/component/generator/templates/metadata/agentForTeams.js.map +1 -1
- package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/index.js +0 -3
- package/build/component/generator/templates/metadata/index.js.map +1 -1
- package/build/component/generator/templates/metadata/me.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/me.js +6 -0
- package/build/component/generator/templates/metadata/me.js.map +1 -1
- package/build/component/generator/templates/metadata/special.js +6 -6
- package/build/component/generator/templates/metadata/special.js.map +1 -1
- package/build/component/generator/templates/metadata/tab.js +7 -7
- package/build/component/generator/templates/metadata/tab.js.map +1 -1
- package/build/component/generator/templates/metadata/wxp.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/wxp.js +6 -0
- package/build/component/generator/templates/metadata/wxp.js.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +2 -3
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +2 -4
- package/build/component/generator/templates/templateNames.js.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.js +8 -6
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
- package/build/component/m365/constants.d.ts +1 -0
- package/build/component/m365/constants.d.ts.map +1 -1
- package/build/component/m365/constants.js +2 -1
- package/build/component/m365/constants.js.map +1 -1
- package/build/component/m365/packageService.d.ts +6 -1
- package/build/component/m365/packageService.d.ts.map +1 -1
- package/build/component/m365/packageService.js +45 -8
- package/build/component/m365/packageService.js.map +1 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +1 -29
- package/build/core/FxCore.js.map +1 -1
- package/build/core/collaborator.d.ts +1 -0
- package/build/core/collaborator.d.ts.map +1 -1
- package/build/core/collaborator.js +55 -29
- package/build/core/collaborator.js.map +1 -1
- package/build/core/share.d.ts.map +1 -1
- package/build/core/share.js +16 -2
- package/build/core/share.js.map +1 -1
- package/build/error/depCheck.js +1 -1
- package/build/error/depCheck.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/question/collaborator.d.ts +6 -0
- package/build/question/collaborator.d.ts.map +1 -0
- package/build/question/collaborator.js +166 -0
- package/build/question/collaborator.js.map +1 -0
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +7 -15
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +3 -2
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/ShareInputs.d.ts +2 -2
- package/build/question/inputs/ShareInputs.d.ts.map +1 -1
- package/build/question/options/ShareOptions.js +1 -1
- package/build/question/options/ShareOptions.js.map +1 -1
- package/build/question/other.d.ts +1 -4
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +2 -145
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +2 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +2 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/vs/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vs/createRootNode.js +9 -11
- package/build/question/scaffold/vs/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +4 -8
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +26 -44
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +2 -4
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.js +5 -14
- package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
- package/build/question/scaffold/vsc/createFromTdpNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createFromTdpNode.js +12 -33
- package/build/question/scaffold/vsc/createFromTdpNode.js.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.d.ts +2 -1
- package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.js +25 -39
- package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/customEngineAgentNode.js +2 -2
- package/build/question/scaffold/vsc/customEngineAgentNode.js.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js +3 -0
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +4 -2
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +159 -11
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/question/share.d.ts +1 -3
- package/build/question/share.d.ts.map +1 -1
- package/build/question/share.js +2 -14
- package/build/question/share.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/resource/package.nls.json +21 -19
- package/resource/template-info/vsc.json +536 -0
- package/resource/yaml-schema/v1.10/yaml.schema.json +2058 -0
- package/resource/yaml-schema/yaml.schema.json +5 -54
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/BotAuthenticationOptions.cs +44 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IIdentityClientAdapter.cs +21 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/ITeamsInfo.cs +24 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IdentityClientAdapter.cs +30 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoDialog.cs +12 -9
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoOperations.cs +2 -2
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPrompt.cs +423 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptSettings.cs +41 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptTokenResponse.cs +21 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsInfoWrapper.cs +20 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsSsoBot.cs +6 -5
- package/build/component/driver/share/shareToOthers.d.ts +0 -17
- package/build/component/driver/share/shareToOthers.d.ts.map +0 -1
- package/build/component/driver/share/shareToOthers.js +0 -127
- package/build/component/driver/share/shareToOthers.js.map +0 -1
- package/build/component/generator/templates/metadata/tdp.d.ts +0 -3
- package/build/component/generator/templates/metadata/tdp.d.ts.map +0 -1
- package/build/component/generator/templates/metadata/tdp.js +0 -51
- package/build/component/generator/templates/metadata/tdp.js.map +0 -1
- package/build/question/scaffold/vsc/agentForTeamsNode.d.ts +0 -6
- package/build/question/scaffold/vsc/agentForTeamsNode.d.ts.map +0 -1
- package/build/question/scaffold/vsc/agentForTeamsNode.js +0 -146
- package/build/question/scaffold/vsc/agentForTeamsNode.js.map +0 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"version": {
|
|
15
15
|
"type": "string",
|
|
16
16
|
"description": "The version of the yaml file schema",
|
|
17
|
-
"const": "v1.
|
|
17
|
+
"const": "v1.10"
|
|
18
18
|
},
|
|
19
19
|
"additionalMetadata": {
|
|
20
20
|
"type": "object",
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
{ "$ref": "#/definitions/apiKeyUpdate"},
|
|
82
82
|
{ "$ref": "#/definitions/oauthRegister"},
|
|
83
83
|
{ "$ref": "#/definitions/oauthUpdate"},
|
|
84
|
-
{ "$ref": "#/definitions/shareToOthers"},
|
|
85
84
|
{ "$ref": "#/definitions/devChannelCreate"},
|
|
86
85
|
{ "$ref": "#/definitions/devChannelInstallApp"},
|
|
87
86
|
{ "$ref": "#/definitions/typeSpecCompile"}
|
|
@@ -1385,58 +1384,10 @@
|
|
|
1385
1384
|
"appPackagePath": {
|
|
1386
1385
|
"type": "string",
|
|
1387
1386
|
"description": "path to app package"
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
"writeToEnvironmentFile": {
|
|
1392
|
-
"type": "object",
|
|
1393
|
-
"additionalProperties": false,
|
|
1394
|
-
"description": "Write environment variables to environment file",
|
|
1395
|
-
"required": ["titleId", "appId"],
|
|
1396
|
-
"properties": {
|
|
1397
|
-
"titleId": {
|
|
1398
|
-
"description": "Required. The ID of M365 title.",
|
|
1399
|
-
"$ref": "#/definitions/envVarName"
|
|
1400
1387
|
},
|
|
1401
|
-
"
|
|
1402
|
-
"description": "Required. The app ID of M365 title.",
|
|
1403
|
-
"$ref": "#/definitions/envVarName"
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
},
|
|
1409
|
-
"shareToOthers": {
|
|
1410
|
-
"type": "object",
|
|
1411
|
-
"additionalProperties": false,
|
|
1412
|
-
"description": "Share apps to others.",
|
|
1413
|
-
"required": ["uses", "with"],
|
|
1414
|
-
"properties": {
|
|
1415
|
-
"name": {
|
|
1416
|
-
"type": "string",
|
|
1417
|
-
"description": "An optional name of this action."
|
|
1418
|
-
},
|
|
1419
|
-
"env": {
|
|
1420
|
-
"type": "object",
|
|
1421
|
-
"description": "Define environment variables for this action.",
|
|
1422
|
-
"additionalProperties": {
|
|
1423
|
-
"type": "string"
|
|
1424
|
-
}
|
|
1425
|
-
},
|
|
1426
|
-
"uses": {
|
|
1427
|
-
"type": "string",
|
|
1428
|
-
"description": "Share apps to others.",
|
|
1429
|
-
"const": "teamsApp/shareToOthers"
|
|
1430
|
-
},
|
|
1431
|
-
"with": {
|
|
1432
|
-
"type": "object",
|
|
1433
|
-
"additionalProperties": false,
|
|
1434
|
-
"description": "parameters for this action",
|
|
1435
|
-
"required": ["appPackagePath"],
|
|
1436
|
-
"properties": {
|
|
1437
|
-
"appPackagePath": {
|
|
1388
|
+
"scope": {
|
|
1438
1389
|
"type": "string",
|
|
1439
|
-
"description": "
|
|
1390
|
+
"description": "The scope of the app (only works for declarative agent). personal is only visible to the owners. shared can be visible to other users in the tenant. Default is personal"
|
|
1440
1391
|
}
|
|
1441
1392
|
}
|
|
1442
1393
|
},
|
|
@@ -1444,7 +1395,7 @@
|
|
|
1444
1395
|
"type": "object",
|
|
1445
1396
|
"additionalProperties": false,
|
|
1446
1397
|
"description": "Write environment variables to environment file",
|
|
1447
|
-
"required": ["titleId", "appId"
|
|
1398
|
+
"required": ["titleId", "appId"],
|
|
1448
1399
|
"properties": {
|
|
1449
1400
|
"titleId": {
|
|
1450
1401
|
"description": "Required. The ID of M365 title.",
|
|
@@ -1455,7 +1406,7 @@
|
|
|
1455
1406
|
"$ref": "#/definitions/envVarName"
|
|
1456
1407
|
},
|
|
1457
1408
|
"shareLink": {
|
|
1458
|
-
"description": "
|
|
1409
|
+
"description": "Optional. The share link of the app.",
|
|
1459
1410
|
"$ref": "#/definitions/envVarName"
|
|
1460
1411
|
}
|
|
1461
1412
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using System.ComponentModel.DataAnnotations;
|
|
5
|
+
|
|
6
|
+
namespace {{YOUR_NAMESPACE}}.Configuration;
|
|
7
|
+
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Bot related authentication configuration.
|
|
10
|
+
/// </summary>
|
|
11
|
+
public class BotAuthenticationOptions
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// The client (application) ID of an App Registration in the tenant.
|
|
15
|
+
/// </summary>
|
|
16
|
+
[Required(ErrorMessage = "Client id is required")]
|
|
17
|
+
[RegularExpression(@"^[0-9A-Fa-f\-]{36}$")]
|
|
18
|
+
public string ClientId { get; set; }
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
/// The client (application) Secret of an App Registration in the tenant.
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Required(ErrorMessage = "Client secret is required")]
|
|
24
|
+
public string ClientSecret { get; set; }
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
/// Authority URL that is used in OAuth On-behalf-of flow.
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Required(ErrorMessage = "OAuth authority is required")]
|
|
30
|
+
[RegularExpression(@"^http(s)?://[-a-zA-Z0-9@:%._\+~#=/]{1,100}$")]
|
|
31
|
+
public string OAuthAuthority { get; set; }
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// Application ID URI.
|
|
35
|
+
/// </summary>
|
|
36
|
+
[Required(ErrorMessage = "Application id uri is required")]
|
|
37
|
+
public string ApplicationIdUri { get; set; }
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
/// Login authentication start page endpoint.
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Required(ErrorMessage = "Login authentication start page endpoint is required")]
|
|
43
|
+
public string InitiateLoginEndpoint { get; set; }
|
|
44
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using Microsoft.Identity.Client;
|
|
5
|
+
|
|
6
|
+
namespace {{YOUR_NAMESPACE}}.SSO
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Adapter of IConfidentialClientApplication On-behalf-of flow.
|
|
10
|
+
/// </summary>
|
|
11
|
+
public interface IIdentityClientAdapter
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// Use On-behalf-of flow to exchange access token.
|
|
15
|
+
/// </summary>
|
|
16
|
+
/// <param name="ssoToken">token from Teams client</param>
|
|
17
|
+
/// <param name="scopes">required scopes</param>
|
|
18
|
+
/// <returns></returns>
|
|
19
|
+
Task<AuthenticationResult> GetAccessToken(string ssoToken, IEnumerable<string> scopes);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using Microsoft.Agents.Builder;
|
|
5
|
+
using Microsoft.Agents.Extensions.Teams.Models;
|
|
6
|
+
|
|
7
|
+
namespace {{YOUR_NAMESPACE}}.SSO
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
/// provides utility methods for interactions that occur within Microsoft Teams.
|
|
11
|
+
/// </summary>
|
|
12
|
+
public interface ITeamsInfo
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// Gets the account of a single conversation member.
|
|
16
|
+
/// This works in one-on-one, group, and teams scoped conversations.
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <param name="context"> Turn context. </param>
|
|
19
|
+
/// <param name="userId"> ID of the user in question. </param>
|
|
20
|
+
/// <param name="cancellationToken"> cancellation token. </param>
|
|
21
|
+
/// <returns>Team Account Details.</returns>
|
|
22
|
+
Task<TeamsChannelAccount> GetTeamsMemberAsync(ITurnContext context, string userId, CancellationToken cancellationToken = default);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using Microsoft.Identity.Client;
|
|
5
|
+
|
|
6
|
+
namespace {{YOUR_NAMESPACE}}.SSO
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Helper class used to simplify unit test.
|
|
10
|
+
/// https://stackoverflow.com/questions/65334284/how-to-mock-moq-iconfidentialclientapplication-which-has-sealed-setup-abstract
|
|
11
|
+
/// </summary>
|
|
12
|
+
internal class IdentityClientAdapter : IIdentityClientAdapter
|
|
13
|
+
{
|
|
14
|
+
private readonly IConfidentialClientApplication _confidentialClientApplication;
|
|
15
|
+
|
|
16
|
+
public IdentityClientAdapter(IConfidentialClientApplication confidentialClientApplication)
|
|
17
|
+
{
|
|
18
|
+
_confidentialClientApplication = confidentialClientApplication;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async Task<AuthenticationResult> GetAccessToken(string ssoToken, IEnumerable<string> scopes)
|
|
22
|
+
{
|
|
23
|
+
var userAssertion = new UserAssertion(ssoToken);
|
|
24
|
+
return await _confidentialClientApplication
|
|
25
|
+
.AcquireTokenOnBehalfOf(scopes, userAssertion)
|
|
26
|
+
.ExecuteAsync()
|
|
27
|
+
.ConfigureAwait(false);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
using
|
|
2
|
-
using
|
|
3
|
-
using Microsoft.
|
|
1
|
+
using {{YOUR_NAMESPACE}}.Configuration;
|
|
2
|
+
using Json.More;
|
|
3
|
+
using Microsoft.Agents.Builder;
|
|
4
|
+
using Microsoft.Agents.Builder.Dialogs;
|
|
5
|
+
using Microsoft.Agents.Builder.State;
|
|
6
|
+
using Microsoft.Agents.Core.Models;
|
|
7
|
+
using Microsoft.Agents.Storage;
|
|
4
8
|
using Microsoft.Extensions.Options;
|
|
5
|
-
using Microsoft.TeamsFx.Bot;
|
|
6
|
-
using Microsoft.TeamsFx.Configuration;
|
|
7
9
|
|
|
8
10
|
namespace {{YOUR_NAMESPACE}}.SSO;
|
|
9
11
|
|
|
@@ -173,9 +175,10 @@ public class SsoDialog : ComponentDialog
|
|
|
173
175
|
|
|
174
176
|
private async Task<bool> ShouldDedup(ITurnContext context)
|
|
175
177
|
{
|
|
178
|
+
var tokenResponseObject = context.Activity.Value.ToJsonDocument();
|
|
176
179
|
var storeItem = new StoreItem()
|
|
177
180
|
{
|
|
178
|
-
eTag =
|
|
181
|
+
eTag = tokenResponseObject.RootElement.GetProperty("id").ToString(),
|
|
179
182
|
};
|
|
180
183
|
var key = GetStorageKey(context);
|
|
181
184
|
var storeItems = new Dictionary<string, object>()
|
|
@@ -209,13 +212,13 @@ public class SsoDialog : ComponentDialog
|
|
|
209
212
|
throw new Exception("TokenExchangeState can only be used with Invokes of signin/tokenExchange.");
|
|
210
213
|
}
|
|
211
214
|
|
|
212
|
-
var value = activity.Value;
|
|
213
|
-
if (value == null || (
|
|
215
|
+
var value = activity.Value.ToJsonDocument();
|
|
216
|
+
if (value == null || value.RootElement.GetProperty("id").ToString() == null)
|
|
214
217
|
{
|
|
215
218
|
throw new Exception("Invalid signin/tokenExchange. Missing activity.value.id.");
|
|
216
219
|
}
|
|
217
220
|
|
|
218
|
-
return $"{channelId}/{conversationId}/{(
|
|
221
|
+
return $"{channelId}/{conversationId}/{value.RootElement.GetProperty("id").ToString()}";
|
|
219
222
|
}
|
|
220
223
|
|
|
221
224
|
private string MatchCommands(string text)
|