/// <summary> /// Ctor. Only call if on Win10, otherwise a TypeLoadException occurs. See DesktopOsHelper.IsWin10 /// </summary> public WamBroker( CoreUIParent uiParent, ApplicationConfiguration appConfig, ICoreLogger logger, IWamPlugin testAadPlugin = null, IWamPlugin testmsaPlugin = null, IWamProxy wamProxy = null, IWebAccountProviderFactory webAccountProviderFactory = null, IAccountPickerFactory accountPickerFactory = null, IMsaPassthroughHandler msaPassthroughHandler = null) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _synchronizationContext = uiParent?.SynchronizationContext; _wamProxy = wamProxy ?? new WamProxy(_logger, _synchronizationContext); _parentHandle = GetParentWindow(uiParent); _webAccountProviderFactory = webAccountProviderFactory ?? new WebAccountProviderFactory(); _accountPickerFactory = accountPickerFactory ?? new AccountPickerFactory(); _aadPlugin = testAadPlugin ?? new AadPlugin(_wamProxy, _webAccountProviderFactory, _logger); _msaPlugin = testmsaPlugin ?? new MsaPlugin(_wamProxy, _webAccountProviderFactory, _logger); _msaPassthroughHandler = msaPassthroughHandler ?? new MsaPassthroughHandler(_logger, _msaPlugin, _wamProxy, _parentHandle); _wamOptions = appConfig.WindowsBrokerOptions ?? WindowsBrokerOptions.CreateDefault(); }
public void Init() { _synchronizationContext = new DedicatedThreadSynchronisationContext(); _coreUIParent = new CoreUIParent() { SynchronizationContext = _synchronizationContext }; _logger = Substitute.For <ICoreLogger>(); _aadPlugin = Substitute.For <IWamPlugin>(); _msaPlugin = Substitute.For <IWamPlugin>(); _wamProxy = Substitute.For <IWamProxy>(); _webAccountProviderFactory = Substitute.For <IWebAccountProviderFactory>(); _accountPickerFactory = Substitute.For <IAccountPickerFactory>(); _wamBroker = new WamBroker( _coreUIParent, _logger, _aadPlugin, _msaPlugin, _wamProxy, _webAccountProviderFactory, _accountPickerFactory); }
public void Init() { _logger = Substitute.For <ICoreLogger>(); _wamProxy = Substitute.For <IWamProxy>(); _webAccountProviderFactory = Substitute.For <IWebAccountProviderFactory>(); _accountPickerFactory = Substitute.For <IAccountPickerFactory>(); _webAccountProviderFactory.ClearReceivedCalls(); _cacheSessionManager = Substitute.For <ICacheSessionManager>(); _instanceDiscoveryManager = Substitute.For <IInstanceDiscoveryManager>(); _aadPlugin = new AadPlugin(_wamProxy, _webAccountProviderFactory, _logger); }
public WamBroker( CoreUIParent uiParent, ICoreLogger logger, IWamPlugin testAadPlugin = null, IWamPlugin testmsaPlugin = null, IWamProxy wamProxy = null, IWebAccountProviderFactory webAccountProviderFactory = null, IAccountPickerFactory accountPickerFactory = null) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _wamProxy = wamProxy ?? new WamProxy(_logger); _parentHandle = GetParentWindow(uiParent); _synchronizationContext = uiParent?.SynchronizationContext; _webAccountProviderFactory = webAccountProviderFactory ?? new WebAccountProviderFactory(); _accountPickerFactory = accountPickerFactory ?? new AccountPickerFactory(); _aadPlugin = testAadPlugin ?? new AadPlugin(_wamProxy, _webAccountProviderFactory, _logger); _msaPlugin = testmsaPlugin ?? new MsaPlugin(_wamProxy, _webAccountProviderFactory, _logger); }