public TokenExchangeSkillHandler(
            BotAdapter adapter,
            IBot bot,
            IConfiguration configuration,
            SkillConversationIdFactoryBase conversationIdFactory,
            SkillsConfiguration skillsConfig,
            SkillHttpClient skillClient,
            ICredentialProvider credentialProvider,
            AuthenticationConfiguration authConfig,
            IChannelProvider channelProvider = null,
            ILogger logger = null)
            : base(adapter, bot, conversationIdFactory, credentialProvider, authConfig, channelProvider, logger)
        {
            _adapter = adapter;
            _tokenExchangeProvider = adapter as IExtendedUserTokenProvider;
            if (_tokenExchangeProvider == null)
            {
                throw new ArgumentException($"{nameof(adapter)} does not support token exchange");
            }

            _skillsConfig          = skillsConfig;
            _skillClient           = skillClient;
            _conversationIdFactory = conversationIdFactory;

            _botId          = configuration.GetSection(MicrosoftAppCredentials.MicrosoftAppIdKey)?.Value;
            _connectionName = configuration.GetSection("ConnectionName")?.Value;
        }
        public AdapterWithErrorHandler(BotFrameworkAuthentication auth, IConfiguration configuration, ILogger <IBotFrameworkHttpAdapter> logger, ConversationState conversationState, SkillsConfiguration skillsConfig = null)
            : base(auth, logger)
        {
            _auth              = auth ?? throw new ArgumentNullException(nameof(auth));
            _configuration     = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _conversationState = conversationState ?? throw new ArgumentNullException(nameof(conversationState));
            _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
            _skillsConfig      = skillsConfig;

            OnTurnError = HandleTurnError;
        }
        public AdapterWithErrorHandler(IConfiguration configuration, ILogger <BotFrameworkHttpAdapter> logger, ConversationState conversationState = null, SkillHttpClient skillClient = null, SkillsConfiguration skillsConfig = null)
            : base(configuration, logger)
        {
            _configuration     = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _conversationState = conversationState;
            _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
            _skillClient       = skillClient;
            _skillsConfig      = skillsConfig;

            OnTurnError = HandleTurnError;
        }
Esempio n. 4
0
        public TokenExchangeSkillHandler(
            BotAdapter adapter,
            IBot bot,
            SkillConversationIdFactoryBase conversationIdFactory,
            BotFrameworkAuthentication auth,
            SkillsConfiguration skillsConfiguration,
            IConfiguration configuration,
            ILogger <TokenExchangeSkillHandler> logger = null)
            : base(adapter, bot, conversationIdFactory, auth, logger)
        {
            _adapter = adapter ?? throw new ArgumentNullException(nameof(adapter));
            _auth    = auth ?? throw new ArgumentNullException(nameof(auth));
            _conversationIdFactory = conversationIdFactory ?? throw new ArgumentNullException(nameof(conversationIdFactory));
            _skillsConfig          = skillsConfiguration ?? throw new ArgumentNullException(nameof(skillsConfiguration));

            _botId          = configuration.GetSection(MicrosoftAppCredentials.MicrosoftAppIdKey)?.Value;
            _connectionName = configuration.GetSection("ConnectionName")?.Value;
            _logger         = logger ?? NullLogger <TokenExchangeSkillHandler> .Instance;
        }