public void ListSamlOptions(ProviderTestConfig config) { var handler = new MockMessageHandler() { Response = ListConfigsResponses, }; var auth = config.CreateAuth(handler); var configs = new List <SamlProviderConfig>(); var customOptions = new ListProviderConfigsOptions() { PageSize = 3, PageToken = "custom-token", }; var pagedEnumerable = auth.ListSamlProviderConfigsAsync(customOptions); foreach (var user in pagedEnumerable.ToEnumerable()) { configs.Add(user); } Assert.Equal(5, configs.Count); Assert.All(configs, this.AssertSamlProviderConfig); Assert.Equal(2, handler.Requests.Count); config.AssertRequest( "inboundSamlConfigs?pageSize=3&pageToken=custom-token", handler.Requests[0]); config.AssertRequest( "inboundSamlConfigs?pageSize=3&pageToken=token", handler.Requests[1]); }
public void ListOidcInvalidOptions(ListProviderConfigsOptions options, string expected) { var handler = new MockMessageHandler() { Response = ListConfigsResponses, }; var auth = ProviderConfigTestUtils.CreateFirebaseAuth(handler); var exception = Assert.Throws<ArgumentException>( () => auth.ListOidcProviderConfigsAsync(options)); Assert.Equal(expected, exception.Message); Assert.Empty(handler.Requests); }
internal static async Task ListOidcProviderConfigs() { // [START list_oidc_providers] var listOptions = new ListProviderConfigsOptions() { PageToken = "nextPageToken", }; IAsyncEnumerator <OidcProviderConfig> enumerator = FirebaseAuth.DefaultInstance .ListOidcProviderConfigsAsync(listOptions) .GetAsyncEnumerator(); while (await enumerator.MoveNextAsync()) { OidcProviderConfig oidc = enumerator.Current; Console.WriteLine(oidc.ProviderId); } // [END list_oidc_providers] }
public void ListSamlOptions() { var handler = new MockMessageHandler() { Response = ListConfigsResponses, }; var auth = ProviderConfigTestUtils.CreateFirebaseAuth(handler); var configs = new List <SamlProviderConfig>(); var customOptions = new ListProviderConfigsOptions() { PageSize = 3, PageToken = "custom-token", }; var pagedEnumerable = auth.ListSamlProviderConfigsAsync(customOptions); foreach (var user in pagedEnumerable.ToEnumerable()) { configs.Add(user); } Assert.Equal(5, configs.Count); Assert.All(configs, this.AssertSamlProviderConfig); Assert.Equal(2, handler.Requests.Count); var query = ProviderConfigTestUtils.ExtractQueryParams(handler.Requests[0]); Assert.Equal(2, query.Count); Assert.Equal("3", query["pageSize"]); Assert.Equal("custom-token", query["pageToken"]); query = ProviderConfigTestUtils.ExtractQueryParams(handler.Requests[1]); Assert.Equal(2, query.Count); Assert.Equal("3", query["pageSize"]); Assert.Equal("token", query["pageToken"]); Assert.All(handler.Requests, ProviderConfigTestUtils.AssertClientVersionHeader); }