public override IBroker CreateBroker(ApplicationConfiguration appConfig, CoreUIParent uiParent) { if (DesktopOsHelper.IsWin10()) { return(appConfig.BrokerCreatorFunc != null? appConfig.BrokerCreatorFunc(uiParent, appConfig, Logger) : new Features.WamBroker.WamBroker(uiParent, appConfig, Logger)); } else { Logger.Info("Not a Win10 machine. WAM is not available"); return(new NullBroker()); } }
internal static void AddSupportForWam(PublicClientApplicationBuilder builder) { if (DesktopOsHelper.IsWin10()) { builder.Config.BrokerCreatorFunc = (uiParent, appConfig, logger) => new Platforms.Features.WamBroker.WamBroker(uiParent, appConfig, logger); } else { builder.Config.BrokerCreatorFunc = (uiParent, appConfig, logger) => { logger.Info("Not a Win10 machine. WAM is not available"); return(new NullBroker()); }; } }
public void IsBrokerAvailable_OldDotNet() { var builder1 = PublicClientApplicationBuilder .Create(TestConstants.ClientId); // broker is not available out of the box Assert.AreEqual(false, builder1.IsBrokerAvailable()); var builder2 = PublicClientApplicationBuilder .Create(TestConstants.ClientId) .WithDesktopFeatures(); // broker is not available out of the box Assert.AreEqual(DesktopOsHelper.IsWin10(), builder2.IsBrokerAvailable()); }