internal ApiClient(
            string projectId,
            string tenantId,
            ErrorHandlingHttpClientArgs <FirebaseAuthException> args)
        {
            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to manage provider"
                          + " configurations.");
            }

            var baseUrl = string.Format(IdToolkitUrl, projectId);

            if (tenantId != null)
            {
                this.BaseUrl = $"{baseUrl}/tenants/{tenantId}";
            }
            else
            {
                this.BaseUrl = baseUrl;
            }

            this.httpClient = new ErrorHandlingHttpClient <FirebaseAuthException>(args);
        }
        internal ApiClient(
            string projectId, ErrorHandlingHttpClientArgs <FirebaseAuthException> args)
        {
            if (string.IsNullOrEmpty(projectId))
            {
                throw new ArgumentException(
                          "Must initialize FirebaseApp with a project ID to manage provider"
                          + " configurations.");
            }

            this.baseUrl    = string.Format(IdToolkitUrl, projectId);
            this.httpClient = new ErrorHandlingHttpClient <FirebaseAuthException>(args);
        }
Exemple #3
0
        internal ProviderConfigManager(Args args)
        {
            args.ThrowIfNull(nameof(args));
            var clientArgs = new ErrorHandlingHttpClientArgs <FirebaseAuthException>()
            {
                HttpClientFactory           = args.ClientFactory,
                Credential                  = args.Credential,
                ErrorResponseHandler        = AuthErrorHandler.Instance,
                RequestExceptionHandler     = AuthErrorHandler.Instance,
                DeserializeExceptionHandler = AuthErrorHandler.Instance,
                RetryOptions                = args.RetryOptions,
            };

            this.apiClient = new ApiClient(args.ProjectId, clientArgs);
        }
        internal ProviderConfigManager(Args args)
        {
            args.ThrowIfNull(nameof(args));
            this.TenantId = args.TenantId;
            if (this.TenantId == string.Empty)
            {
                throw new ArgumentException("Tenant ID must not be empty.");
            }

            var clientArgs = new ErrorHandlingHttpClientArgs <FirebaseAuthException>()
            {
                HttpClientFactory           = args.ClientFactory,
                Credential                  = args.Credential,
                ErrorResponseHandler        = AuthErrorHandler.Instance,
                RequestExceptionHandler     = AuthErrorHandler.Instance,
                DeserializeExceptionHandler = AuthErrorHandler.Instance,
                RetryOptions                = args.RetryOptions,
            };

            this.apiClient = new ApiClient(args.ProjectId, this.TenantId, clientArgs);
        }