public static void AssertRevocationCheckRequest(string tenantId, string emulatorHost, Uri uri) { var options = new Utils.UrlOptions { TenantId = tenantId, EmulatorHost = emulatorHost, }; var expectedUrl = $"{Utils.BuildAuthUrl(ProjectId, options)}/accounts:lookup"; Assert.Equal(expectedUrl, uri.ToString()); }
internal TenantManager(Args args) { if (string.IsNullOrEmpty(args.ProjectId)) { throw new ArgumentException( "Must initialize FirebaseApp with a project ID to manage tenants."); } this.EmulatorHost = args.EmulatorHost; this.app = args.App; this.httpClient = new ErrorHandlingHttpClient <FirebaseAuthException>( args.ToHttpClientArgs()); var options = new Utils.UrlOptions { ApiVersion = "v2", EmulatorHost = this.EmulatorHost, }; this.baseUrl = Utils.BuildAuthUrl(args.ProjectId, options); }
internal FirebaseUserManager(Args args) { this.ProjectId = args.ProjectId; if (string.IsNullOrEmpty(this.ProjectId)) { throw new ArgumentException( "Must initialize FirebaseApp with a project ID to manage users."); } this.TenantId = args.TenantId; if (this.TenantId == string.Empty) { throw new ArgumentException("Tenant ID must not be empty."); } this.EmulatorHost = args.EmulatorHost; this.httpClient = new ErrorHandlingHttpClient <FirebaseAuthException>( new ErrorHandlingHttpClientArgs <FirebaseAuthException>() { HttpClientFactory = args.ClientFactory, Credential = Utils.ResolveCredentials(this.EmulatorHost, args.Credential), ErrorResponseHandler = AuthErrorHandler.Instance, RequestExceptionHandler = AuthErrorHandler.Instance, DeserializeExceptionHandler = AuthErrorHandler.Instance, RetryOptions = args.RetryOptions, }); this.clock = args.Clock ?? SystemClock.Default; var options = new Utils.UrlOptions { TenantId = this.TenantId, EmulatorHost = this.EmulatorHost, }; this.baseUrl = Utils.BuildAuthUrl(this.ProjectId, options); }