private void InitializeServicePrincpalAuthenticationFactory(IPowerBILogger logger, IPowerBISettings settings) { if (ServicePrincipalAuthFactory == null) { if (ServicePrincipalAuthFactory == null) { ServicePrincipalAuthFactory = new ServicePrincipalAuthenticationFactory(); } } BaseAuthFactory = ServicePrincipalAuthFactory; }
private void InitializeUserAuthenticationFactory(IPowerBILogger logger, IPowerBISettings settings) { if (UserAuthFactory == null) { bool forceDeviceAuth = settings.Settings.ForceDeviceCodeAuthentication; if (!forceDeviceAuth && RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { UserAuthFactory = new WindowsAuthenticationFactory(); } else { UserAuthFactory = new DeviceCodeAuthenticationFactory(); } } BaseAuthFactory = UserAuthFactory; }