示例#1
0
 public SkillWebSocketAdapter(
     SkillWebSocketBotAdapter skillWebSocketBotAdapter,
     IAuthenticationProvider authenticationProvider = null,
     IBotTelemetryClient botTelemetryClient         = null)
 {
     _skillWebSocketBotAdapter = skillWebSocketBotAdapter ?? throw new ArgumentNullException(nameof(SkillWebSocketBotAdapter));
     _authenticationProvider   = authenticationProvider;
     _botTelemetryClient       = botTelemetryClient ?? NullBotTelemetryClient.Instance;
     _stopWatch = new Stopwatch();
 }
示例#2
0
        public SkillWebSocketAdapter(
            SkillWebSocketBotAdapter skillWebSocketBotAdapter,
            BotSettingsBase botSettingsBase,
            IWhitelistAuthenticationProvider whitelistAuthenticationProvider,
            IBotTelemetryClient botTelemetryClient = null)
        {
            _skillWebSocketBotAdapter        = skillWebSocketBotAdapter ?? throw new ArgumentNullException(nameof(skillWebSocketBotAdapter));
            _botSettingsBase                 = botSettingsBase ?? throw new ArgumentNullException(nameof(botSettingsBase));
            _whitelistAuthenticationProvider = whitelistAuthenticationProvider ?? throw new ArgumentNullException(nameof(whitelistAuthenticationProvider));
            _authenticationProvider          = new MsJWTAuthenticationProvider(_botSettingsBase.MicrosoftAppId);
            _authenticator = new Authenticator(_authenticationProvider, _whitelistAuthenticationProvider);

            _botTelemetryClient = botTelemetryClient ?? NullBotTelemetryClient.Instance;
            _stopWatch          = new Stopwatch();
        }