From 70d8842e7040609d9866eeb27a166612e6d10252 Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Mon, 3 Jun 2024 14:35:30 -0300 Subject: [PATCH 1/2] Update Skills to net 6 --- .../EchoSkillBot/EchoSkillBot.csproj | 4 ++-- .../SimpleRootBot/SimpleRootBot.csproj | 4 ++-- .../DialogRootBot/DialogRootBot.csproj | 6 +++--- .../DialogSkillBot/DialogSkillBot.csproj | 8 ++++---- .../RootBot/RootBot.csproj | 6 +++--- .../RootBot/TokenExchangeSkillHandler.cs | 12 ++++++++++-- .../SkillBot/SkillBot.csproj | 6 +++--- 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj index 9e5f2570af..9832ac672e 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.EchoSkillBot Microsoft.BotBuilderSamples.EchoSkillBot @@ -9,7 +9,7 @@ - + diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj index 73ef6ed355..d25a103fc0 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.SimpleRootBot Microsoft.BotBuilderSamples.SimpleRootBot @@ -9,7 +9,7 @@ - + diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj index 53dab5cf39..f0d16a3733 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.DialogRootBot Microsoft.BotBuilderSamples.DialogRootBot @@ -17,8 +17,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj index e38f9e607e..21eb88cb01 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.DialogSkillBot Microsoft.BotBuilderSamples.DialogSkillBot @@ -9,9 +9,9 @@ - - - + + + diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj index 9cd53d202c..c78a04d067 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.RootBot Microsoft.BotBuilderSamples.RootBot @@ -13,8 +13,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/TokenExchangeSkillHandler.cs b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/TokenExchangeSkillHandler.cs index 8ab2504db7..bfb643246d 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/TokenExchangeSkillHandler.cs +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/TokenExchangeSkillHandler.cs @@ -74,8 +74,16 @@ protected override async Task OnReplyToActivityAsync(ClaimsIde private BotFrameworkSkill GetCallingSkill(ClaimsIdentity claimsIdentity) { - var botAppIdClaim = claimsIdentity.Claims?.FirstOrDefault(claim => claim.Type == AuthenticationConstants.AppIdClaim); - var appId = botAppIdClaim?.Value; + var version = claimsIdentity.Claims.FirstOrDefault(claim => claim.Type == AuthenticationConstants.VersionClaim)?.Value; + var appId = claimsIdentity.Claims?.FirstOrDefault(claim => + { + if (version == "2.0") + { + return claim.Type == AuthenticationConstants.AuthorizedParty; + } + + return claim.Type == AuthenticationConstants.AppIdClaim; + })?.Value; if (string.IsNullOrWhiteSpace(appId)) { return null; diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj index 2906ada69c..275036d6b4 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 latest Microsoft.BotBuilderSamples.SkillBot Microsoft.BotBuilderSamples.SkillBot @@ -9,8 +9,8 @@ - - + + From c52de8015b271a26a543d8e539263a8138e12542 Mon Sep 17 00:00:00 2001 From: Joel Mut Date: Mon, 3 Jun 2024 14:37:19 -0300 Subject: [PATCH 2/2] Update README --- samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/README.md | 2 +- samples/csharp_dotnetcore/81.skills-skilldialog/README.md | 2 +- samples/csharp_dotnetcore/82.skills-sso-cloudadapter/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/README.md b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/README.md index 4bb6ec4754..3f1fc88f79 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/README.md +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/README.md @@ -6,7 +6,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i ## Prerequisites -- [.NET SDK](https://dotnet.microsoft.com/download) version 6.0 +- [.NET SDK](https://dotnet.microsoft.com/download) version 8.0 ```bash # determine dotnet version diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/README.md b/samples/csharp_dotnetcore/81.skills-skilldialog/README.md index 4f478aa450..5551f78f1b 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/README.md +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/README.md @@ -6,7 +6,7 @@ This bot has been created using the [Bot Framework](https://dev.botframework.com ## Prerequisites -- [.NET SDK](https://dotnet.microsoft.com/download) version 6.0 +- [.NET SDK](https://dotnet.microsoft.com/download) version 8.0 ```bash # determine dotnet version diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/README.md b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/README.md index 432b06c3ad..f5cf14fc23 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/README.md +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/README.md @@ -6,7 +6,7 @@ This bot has been created using [Bot Framework](https://dev.botframework.com), i ## Prerequisites -- [.NET SDK](https://dotnet.microsoft.com/download) version 6.0 +- [.NET SDK](https://dotnet.microsoft.com/download) version 8.0 ```bash # determine dotnet version