@microsoft/teamsfx-core 3.0.5-alpha.cd5b2565b.0 → 3.0.5-alpha.d4a083ca4.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/common/templates-config.json +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +1 -1
- package/build/component/coordinator/index.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/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/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/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/question/questionNames.d.ts +1 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +1 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- 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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using {{YOUR_NAMESPACE}}.Configuration;
|
|
5
|
+
|
|
6
|
+
namespace {{YOUR_NAMESPACE}}.SSO;
|
|
7
|
+
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Contains settings for an <see cref="TeamsBotSsoPrompt"/>.
|
|
10
|
+
/// </summary>
|
|
11
|
+
public class TeamsBotSsoPromptSettings
|
|
12
|
+
{
|
|
13
|
+
|
|
14
|
+
/// <summary>
|
|
15
|
+
/// Constructor of TeamsBotSsoPromptSettings
|
|
16
|
+
/// </summary>
|
|
17
|
+
public TeamsBotSsoPromptSettings(BotAuthenticationOptions botAuthOptions, string[] scopes, int timeout = 900000)
|
|
18
|
+
{
|
|
19
|
+
BotAuthOptions = botAuthOptions;
|
|
20
|
+
Scopes = scopes;
|
|
21
|
+
Timeout = timeout;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
/// Gets or sets the array of strings that declare the desired permissions and the resources requested.
|
|
26
|
+
/// </summary>
|
|
27
|
+
/// <value>The array of strings that declare the desired permissions and the resources requested.</value>
|
|
28
|
+
public string[] Scopes { get; set; }
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
/// Gets or sets the number of milliseconds the prompt waits for the user to authenticate.
|
|
32
|
+
/// Default is 900,000 (15 minutes).
|
|
33
|
+
/// </summary>
|
|
34
|
+
/// <value>The number of milliseconds the prompt waits for the user to authenticate.</value>
|
|
35
|
+
public int Timeout { get; set; }
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// Gets or sets bot related authentication options.
|
|
39
|
+
/// </summary>
|
|
40
|
+
public BotAuthenticationOptions BotAuthOptions { get; set; }
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using Microsoft.Agents.Core.Models;
|
|
5
|
+
namespace {{YOUR_NAMESPACE}}.SSO;
|
|
6
|
+
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Token response provided by Teams Bot SSO prompt
|
|
9
|
+
/// </summary>
|
|
10
|
+
public class TeamsBotSsoPromptTokenResponse : TokenResponse
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
/// SSO token for user
|
|
14
|
+
/// </summary>
|
|
15
|
+
public string SsoToken { get; set; }
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
/// Expiration time of SSO token
|
|
19
|
+
/// </summary>
|
|
20
|
+
public string SsoTokenExpiration { get; set; }
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
using Microsoft.Agents.Builder;
|
|
5
|
+
using Microsoft.Agents.Extensions.Teams.Connector;
|
|
6
|
+
using Microsoft.Agents.Extensions.Teams.Models;
|
|
7
|
+
|
|
8
|
+
namespace {{YOUR_NAMESPACE}}.SSO
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Helper class used to wrap static method and simplify unit test.
|
|
12
|
+
/// </summary>
|
|
13
|
+
internal class TeamsInfoWrapper : ITeamsInfo
|
|
14
|
+
{
|
|
15
|
+
public Task<TeamsChannelAccount> GetTeamsMemberAsync(ITurnContext context, string userId, CancellationToken cancellationToken = default)
|
|
16
|
+
{
|
|
17
|
+
return TeamsInfo.GetMemberAsync(context, userId, cancellationToken);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
using Microsoft.
|
|
2
|
-
using Microsoft.
|
|
3
|
-
using Microsoft.
|
|
4
|
-
using Microsoft.
|
|
1
|
+
using Microsoft.Agents.Extensions.Teams.Compat;
|
|
2
|
+
using Microsoft.Agents.Builder.Dialogs;
|
|
3
|
+
using Microsoft.Agents.Builder.State;
|
|
4
|
+
using Microsoft.Agents.Builder;
|
|
5
|
+
using Microsoft.Agents.Core.Models;
|
|
5
6
|
|
|
6
7
|
namespace {{YOUR_NAMESPACE}}.SSO;
|
|
7
8
|
|
|
8
9
|
public class TeamsSsoBot<T> : TeamsActivityHandler where T : Dialog
|
|
9
10
|
{
|
|
10
11
|
private readonly ILogger<TeamsSsoBot<T>> _logger;
|
|
11
|
-
private readonly
|
|
12
|
+
private readonly AgentState _conversationState;
|
|
12
13
|
private readonly Dialog _dialog;
|
|
13
14
|
private readonly IStatePropertyAccessor<DialogState> _dialogState;
|
|
14
15
|
|