FirebaseAdmin.Auth.Multitenancy.TenantManager

The tenant manager facilitates GCIP multitenancy related operations.

Summary

This includes:

  • Creating, updating, retrieving and deleting tenants in the underlying project.
  • Obtaining TenantAwareFirebaseAuth instances for performing operations (user management, provider configuration management, token verification, email link generation, etc) in the context of a specified tenant.

Inheritance

Inherits from: IDisposable

Public functions

AuthForTenant(string tenantId)
Gets a TenantAwareFirebaseAuth instance scoped to the specified tenant.
CreateTenantAsync(TenantArgs args)
async Task< Tenant >
Creates a new tenant.
CreateTenantAsync(TenantArgs args, CancellationToken cancellationToken)
async Task< Tenant >
Creates a new tenant.
DeleteTenantAsync(string tenantId)
async Task
Deletes the tenant corresponding to the given tenantId .
DeleteTenantAsync(string tenantId, CancellationToken cancellationToken)
async Task
Deletes the tenant corresponding to the given tenantId .
GetTenantAsync(string tenantId)
async Task< Tenant >
Gets the Tenant corresponding to the given tenantId .
GetTenantAsync(string tenantId, CancellationToken cancellationToken)
async Task< Tenant >
Gets the Tenant corresponding to the given tenantId .
ListTenantsAsync(ListTenantsOptions options)
PagedAsyncEnumerable< TenantsPage, Tenant >
Gets an async enumerable to iterate or page through tenants starting from the specified page token.
UpdateTenantAsync(string tenantId, TenantArgs args)
async Task< Tenant >
Updates an existing tenant.
UpdateTenantAsync(string tenantId, TenantArgs args, CancellationToken cancellationToken)
async Task< Tenant >
Updates an existing tenant.

Public functions

AuthForTenant

TenantAwareFirebaseAuth AuthForTenant(
  string tenantId
)

Gets a TenantAwareFirebaseAuth instance scoped to the specified tenant.

Details
Parameters
tenantId
A tenant identifier string.
Exceptions
ArgumentException
If the tenant ID argument is null or empty.
Returns
An object that can be used to perform tenant-aware operations.

CreateTenantAsync

async Task< Tenant > CreateTenantAsync(
  TenantArgs args
)

Creates a new tenant.

Details
Parameters
args
Arguments that describe the new tenant configuration.
Exceptions
ArgumentNullException
If args is null.
FirebaseAuthException
If an unexpected error occurs while creating the tenant.
Returns
A task that completes with a Tenant.

CreateTenantAsync

async Task< Tenant > CreateTenantAsync(
  TenantArgs args,
  CancellationToken cancellationToken
)

Creates a new tenant.

Details
Parameters
args
Arguments that describe the new tenant configuration.
cancellationToken
A cancellation token to monitor the asynchronous operation.
Exceptions
ArgumentNullException
If args is null.
FirebaseAuthException
If an unexpected error occurs while creating the tenant.
Returns
A task that completes with a Tenant.

DeleteTenantAsync

async Task DeleteTenantAsync(
  string tenantId
)

Deletes the tenant corresponding to the given tenantId .

Details
Parameters
tenantId
A tenant identifier string.
Exceptions
ArgumentException
If the tenant ID argument is null or empty.
FirebaseAuthException
If a tenant cannot be found with the specified ID.
Returns
A task that completes when the tenant is deleted.

DeleteTenantAsync

async Task DeleteTenantAsync(
  string tenantId,
  CancellationToken cancellationToken
)

Deletes the tenant corresponding to the given tenantId .

Details
Parameters
tenantId
A tenant identifier string.
cancellationToken
A cancellation token to monitor the asynchronous operation.
Exceptions
ArgumentException
If the tenant ID argument is null or empty.
FirebaseAuthException
If a tenant cannot be found with the specified ID.
Returns
A task that completes when the tenant is deleted.

GetTenantAsync

async Task< Tenant > GetTenantAsync(
  string tenantId
)

Gets the Tenant corresponding to the given tenantId .

Details
Parameters
tenantId
A tenant identifier string.
Exceptions
ArgumentException
If tenant ID argument is null or empty.
FirebaseAuthException
If a tenant cannot be found with the specified ID.
Returns
A task that completes with a Tenant.

GetTenantAsync

async Task< Tenant > GetTenantAsync(
  string tenantId,
  CancellationToken cancellationToken
)

Gets the Tenant corresponding to the given tenantId .

Details
Parameters
tenantId
A tenant identifier string.
cancellationToken
A cancellation token to monitor the asynchronous operation.
Exceptions
ArgumentException
If the tenant ID argument is null or empty.
FirebaseAuthException
If a tenant cannot be found with the specified ID.
Returns
A task that completes with a Tenant.

ListTenantsAsync

PagedAsyncEnumerable< TenantsPage, Tenant > ListTenantsAsync(
  ListTenantsOptions options
)

Gets an async enumerable to iterate or page through tenants starting from the specified page token.

If the page token is null or unspecified, iteration starts from the first page. See Page Streaming for more details on how to use this API.

Details
Parameters
options
The options to control the starting point and page size. Pass null to list from the beginning with default settings.
Returns
A PagedAsyncEnumerable{TenantsPage, Tenant} instance.

UpdateTenantAsync

async Task< Tenant > UpdateTenantAsync(
  string tenantId,
  TenantArgs args
)

Updates an existing tenant.

Details
Parameters
tenantId
ID of the tenant to be updated.
args
Properties to be updated in the tenant.
Exceptions
ArgumentException
If tenantId is null or empty, or if args does not contain any values.
ArgumentNullException
If args is null.
FirebaseAuthException
If an unexpected error occurs while updating the tenant.
Returns
A task that completes with a Tenant.

UpdateTenantAsync

async Task< Tenant > UpdateTenantAsync(
  string tenantId,
  TenantArgs args,
  CancellationToken cancellationToken
)

Updates an existing tenant.

Details
Parameters
tenantId
ID of the tenant to be updated.
args
Properties to be updated in the tenant.
cancellationToken
A cancellation token to monitor the asynchronous operation.
Exceptions
ArgumentException
If tenantId is null or empty, or if args does not contain any values.
ArgumentNullException
If args is null.
FirebaseAuthException
If an unexpected error occurs while updating the tenant.
Returns
A task that completes with a Tenant.