listProviderConfigs method

Future<ListProviderConfigResults> listProviderConfigs(
  1. AuthProviderConfigFilter options
)
inherited

Returns the list of existing provider configurations matching the filter provided. At most, 100 provider configs can be listed at a time.

SAML and OIDC provider support requires Google Cloud's Identity Platform (GCIP). To learn more about GCIP, including pricing and features, see the https://cloud.google.com/identity-platform.

Implementation

Future<ListProviderConfigResults> listProviderConfigs(
  AuthProviderConfigFilter options,
) async {
  if (options._type == _AuthProviderConfigFilterType.oidc) {
    final response = await _authRequestHandler.listOAuthIdpConfigs(
      maxResults: options.maxResults,
      pageToken: options.pageToken,
    );
    return ListProviderConfigResults(
      providerConfigs: [
        // Convert each provider config response to a OIDCConfig.
        ...?response.oauthIdpConfigs?.map(_OIDCConfig.fromResponse),
      ],
      pageToken: response.nextPageToken,
    );
  } else if (options._type == _AuthProviderConfigFilterType.saml) {
    final response = await _authRequestHandler.listInboundSamlConfigs(
      maxResults: options.maxResults,
      pageToken: options.pageToken,
    );
    return ListProviderConfigResults(
      providerConfigs: [
        // Convert each provider config response to a SAMLConfig.
        ...?response.inboundSamlConfigs?.map(_SAMLConfig.fromResponse),
      ],
      pageToken: response.nextPageToken,
    );
  }

  throw FirebaseAuthAdminException(
    AuthClientErrorCode.invalidArgument,
    '"AuthProviderConfigFilter.type" must be either "saml" or "oidc"',
  );
}