public void CanCreateMultiTenantAppWithoutCredentials() { var config = new ConfigurationRoot(new List <IConfigurationProvider> { new MemoryConfigurationProvider(new MemoryConfigurationSource()) }); _ = new ConfigurationServiceClientCredentialFactory(config); }
public void CanCreateMultiTenantAppWithCredentials() { var config = new ConfigurationRoot(new List <IConfigurationProvider> { new MemoryConfigurationProvider(new MemoryConfigurationSource { InitialData = new Dictionary <string, string> { { MicrosoftAppCredentials.MicrosoftAppIdKey, TestAppId }, { MicrosoftAppCredentials.MicrosoftAppPasswordKey, TestAppPassword } } }) }); _ = new ConfigurationServiceClientCredentialFactory(config); }
public void CanCreateManagedIdentityApp() { var config = new ConfigurationRoot(new List <IConfigurationProvider> { new MemoryConfigurationProvider(new MemoryConfigurationSource { InitialData = new Dictionary <string, string> { { MicrosoftAppCredentials.MicrosoftAppTypeKey, "UserAssignedMSI" }, { MicrosoftAppCredentials.MicrosoftAppIdKey, TestAppId }, { MicrosoftAppCredentials.MicrosoftAppTenantIdKey, TestAppTenantId } } }) }); _ = new ConfigurationServiceClientCredentialFactory(config); }
public void CannotCreateManagedIdentityAppWithoutTenantId() { var config = new ConfigurationRoot(new List <IConfigurationProvider> { new MemoryConfigurationProvider(new MemoryConfigurationSource { InitialData = new Dictionary <string, string> { { MicrosoftAppCredentials.MicrosoftAppTypeKey, "UserAssignedMSI" }, { MicrosoftAppCredentials.MicrosoftAppIdKey, TestAppId } } }) }); Assert.Throws <ArgumentException>(() => { _ = new ConfigurationServiceClientCredentialFactory(config); }); }
public void CannotCreateSingleTenantAppWithoutPassword() { var config = new ConfigurationRoot(new List <IConfigurationProvider> { new MemoryConfigurationProvider(new MemoryConfigurationSource { InitialData = new Dictionary <string, string> { { MicrosoftAppCredentials.MicrosoftAppTypeKey, "SingleTenant" }, { MicrosoftAppCredentials.MicrosoftAppIdKey, TestAppId }, { MicrosoftAppCredentials.MicrosoftAppPasswordKey, string.Empty }, { MicrosoftAppCredentials.MicrosoftAppTenantIdKey, TestAppTenantId } } }) }); Assert.Throws <ArgumentException>(() => { _ = new ConfigurationServiceClientCredentialFactory(config); }); }