Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit a64915c

Browse files
authored
get ITokenExchangeConfig from IServiceProvider (#3434)
1 parent 92c1e45 commit a64915c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

samples/csharp/assistants/virtual-assistant/VirtualAssistantSample/TokenExchange/TokenExchangeSkillHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.Bot.Schema;
1616
using Microsoft.Bot.Solutions.Skills;
1717
using Microsoft.Extensions.Configuration;
18+
using Microsoft.Extensions.DependencyInjection;
1819
using Microsoft.Extensions.Logging;
1920
using Newtonsoft.Json.Linq;
2021

@@ -31,6 +32,7 @@ public class TokenExchangeSkillHandler : SkillHandler
3132
private readonly SkillConversationIdFactoryBase _conversationIdFactory;
3233

3334
public TokenExchangeSkillHandler(
35+
IServiceProvider serviceProvider,
3436
BotAdapter adapter,
3537
IBot bot,
3638
IConfiguration configuration,
@@ -39,14 +41,13 @@ public TokenExchangeSkillHandler(
3941
SkillHttpClient skillClient,
4042
ICredentialProvider credentialProvider,
4143
AuthenticationConfiguration authConfig,
42-
ITokenExchangeConfig tokenExchangeConfig,
4344
IChannelProvider channelProvider = null,
4445
ILogger logger = null)
4546
: base(adapter, bot, conversationIdFactory, credentialProvider, authConfig, channelProvider, logger)
4647
{
4748
_adapter = adapter;
4849
_tokenExchangeProvider = adapter as IExtendedUserTokenProvider;
49-
_tokenExchangeConfig = tokenExchangeConfig;
50+
_tokenExchangeConfig = serviceProvider.GetService<ITokenExchangeConfig>();
5051
_skillsConfig = skillsConfig;
5152
_skillClient = skillClient;
5253
_conversationIdFactory = conversationIdFactory;

0 commit comments

Comments
 (0)