FirebaseAdmin. Auth. AbstractFirebaseAuth
Exposes Firebase Auth operations that are available in both tenant-aware and tenant-unaware contexts.
Summary
Inheritance
Inherits from: FirebaseAdmin.IFirebaseServiceDirect Known Subclasses:FirebaseAdmin.Auth.FirebaseAuth, FirebaseAdmin.Auth.Multitenancy.TenantAwareFirebaseAuth
Public functions |
|
---|---|
CreateCustomTokenAsync(string uid)
|
async Task< string >
Creates a Firebase custom token for the given user ID.
|
CreateCustomTokenAsync(string uid, CancellationToken cancellationToken)
|
async Task< string >
Creates a Firebase custom token for the given user ID.
|
CreateCustomTokenAsync(string uid, IDictionary< string, object > developerClaims)
|
async Task< string >
Creates a Firebase custom token for the given user ID containing the specified additional claims.
|
CreateCustomTokenAsync(string uid, IDictionary< string, object > developerClaims, CancellationToken cancellationToken)
|
async Task< string >
Creates a Firebase custom token for the given user ID containing the specified additional claims.
|
CreateProviderConfigAsync< T >(AuthProviderConfigArgs< T > args)
|
async Task< T >
Creates a new auth provider configuration.
|
CreateProviderConfigAsync< T >(AuthProviderConfigArgs< T > args, CancellationToken cancellationToken)
|
async Task< T >
Creates a new auth provider configuration.
|
CreateUserAsync(UserRecordArgs args)
|
async Task< UserRecord >
Creates a new user account with the attributes contained in the specified UserRecordArgs.
|
CreateUserAsync(UserRecordArgs args, CancellationToken cancellationToken)
|
async Task< UserRecord >
Creates a new user account with the attributes contained in the specified UserRecordArgs.
|
DeleteProviderConfigAsync(string providerId)
|
async Task
Deletes the specified auth provider configuration.
|
DeleteProviderConfigAsync(string providerId, CancellationToken cancellationToken)
|
async Task
Deletes the specified auth provider configuration.
|
DeleteUserAsync(string uid)
|
async Task
Deletes the user identified by the specified uid .
|
DeleteUserAsync(string uid, CancellationToken cancellationToken)
|
async Task
Deletes the user identified by the specified uid .
|
DeleteUsersAsync(IReadOnlyList< string > uids)
|
async Task< DeleteUsersResult >
Deletes the users specified by the given identifiers.
|
DeleteUsersAsync(IReadOnlyList< string > uids, CancellationToken cancellationToken)
|
async Task< DeleteUsersResult >
Deletes the users specified by the given identifiers.
|
GenerateEmailVerificationLinkAsync(string email)
|
async Task< string >
Generates the out-of-band email action link for email verification flows for the specified email address.
|
GenerateEmailVerificationLinkAsync(string email, ActionCodeSettings settings)
|
async Task< string >
Generates the out-of-band email action link for email verification flows for the specified email address.
|
GenerateEmailVerificationLinkAsync(string email, ActionCodeSettings settings, CancellationToken cancellationToken)
|
async Task< string >
Generates the out-of-band email action link for email verification flows for the specified email address.
|
GeneratePasswordResetLinkAsync(string email)
|
async Task< string >
Generates the out-of-band email action link for password reset flows for the specified email address.
|
GeneratePasswordResetLinkAsync(string email, ActionCodeSettings settings)
|
async Task< string >
Generates the out-of-band email action link for password reset flows for the specified email address.
|
GeneratePasswordResetLinkAsync(string email, ActionCodeSettings settings, CancellationToken cancellationToken)
|
async Task< string >
Generates the out-of-band email action link for password reset flows for the specified email address.
|
GenerateSignInWithEmailLinkAsync(string email, ActionCodeSettings settings)
|
async Task< string >
Generates the out-of-band email action link for email link sign-in flows for the specified email address.
|
GenerateSignInWithEmailLinkAsync(string email, ActionCodeSettings settings, CancellationToken cancellationToken)
|
async Task< string >
Generates the out-of-band email action link for email link sign-in flows for the specified email address.
|
GetOidcProviderConfigAsync(string providerId)
|
async Task< OidcProviderConfig >
Looks up an OIDC auth provider configuration by the provided ID.
|
GetOidcProviderConfigAsync(string providerId, CancellationToken cancellationToken)
|
async Task< OidcProviderConfig >
Looks up an OIDC auth provider configuration by the provided ID.
|
GetSamlProviderConfigAsync(string providerId)
|
async Task< SamlProviderConfig >
Looks up a SAML auth provider configuration by the provided ID.
|
GetSamlProviderConfigAsync(string providerId, CancellationToken cancellationToken)
|
async Task< SamlProviderConfig >
Looks up a SAML auth provider configuration by the provided ID.
|
GetUserAsync(string uid)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user who's user ID was specified in uid .
|
GetUserAsync(string uid, CancellationToken cancellationToken)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user who's user ID was specified in uid .
|
GetUserByEmailAsync(string email)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user identified by email .
|
GetUserByEmailAsync(string email, CancellationToken cancellationToken)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user identified by email .
|
GetUserByPhoneNumberAsync(string phoneNumber)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user identified by phoneNumber .
|
GetUserByPhoneNumberAsync(string phoneNumber, CancellationToken cancellationToken)
|
async Task< UserRecord >
Gets a UserRecord object containing information about the user identified by phoneNumber .
|
GetUsersAsync(IReadOnlyCollection< UserIdentifier > identifiers)
|
async Task< GetUsersResult >
Gets the user data corresponding to the specified identifiers.
|
GetUsersAsync(IReadOnlyCollection< UserIdentifier > identifiers, CancellationToken cancellationToken)
|
async Task< GetUsersResult >
Gets the user data corresponding to the specified identifiers.
|
ImportUsersAsync(IEnumerable< ImportUserRecordArgs > users)
|
async Task< UserImportResult >
Imports the provided list of users into Firebase Auth.
|
ImportUsersAsync(IEnumerable< ImportUserRecordArgs > users, CancellationToken cancellationToken)
|
async Task< UserImportResult >
Imports the provided list of users into Firebase Auth.
|
ImportUsersAsync(IEnumerable< ImportUserRecordArgs > users, UserImportOptions options)
|
async Task< UserImportResult >
Imports the provided list of users into Firebase Auth.
|
ImportUsersAsync(IEnumerable< ImportUserRecordArgs > users, UserImportOptions options, CancellationToken cancellationToken)
|
async Task< UserImportResult >
Imports the provided list of users into Firebase Auth.
|
ListOidcProviderConfigsAsync(ListProviderConfigsOptions options)
|
PagedAsyncEnumerable< AuthProviderConfigs< OidcProviderConfig >, OidcProviderConfig >
Gets an async enumerable to iterate or page through OIDC provider configurations starting from the specified page token.
|
ListSamlProviderConfigsAsync(ListProviderConfigsOptions options)
|
PagedAsyncEnumerable< AuthProviderConfigs< SamlProviderConfig >, SamlProviderConfig >
Gets an async enumerable to iterate or page through SAML provider configurations starting from the specified page token.
|
ListUsersAsync(ListUsersOptions options)
|
PagedAsyncEnumerable< ExportedUserRecords, ExportedUserRecord >
Gets an async enumerable to iterate or page through users starting from the specified page token.
|
RevokeRefreshTokensAsync(string uid)
|
async Task
Revokes all refresh tokens for the specified user.
|
RevokeRefreshTokensAsync(string uid, CancellationToken cancellationToken)
|
async Task
Revokes all refresh tokens for the specified user.
|
SetCustomUserClaimsAsync(string uid, IReadOnlyDictionary< string, object > claims)
|
async Task
Sets the specified custom claims on an existing user account.
|
SetCustomUserClaimsAsync(string uid, IReadOnlyDictionary< string, object > claims, CancellationToken cancellationToken)
|
async Task
Sets the specified custom claims on an existing user account.
|
UpdateProviderConfigAsync< T >(AuthProviderConfigArgs< T > args)
|
async Task< T >
Updates an existing auth provider configuration.
|
UpdateProviderConfigAsync< T >(AuthProviderConfigArgs< T > args, CancellationToken cancellationToken)
|
async Task< T >
Updates an existing auth provider configuration.
|
UpdateUserAsync(UserRecordArgs args)
|
async Task< UserRecord >
Updates an existing user account with the attributes contained in the specified UserRecordArgs.
|
UpdateUserAsync(UserRecordArgs args, CancellationToken cancellationToken)
|
async Task< UserRecord >
Updates an existing user account with the attributes contained in the specified UserRecordArgs.
|
VerifyIdTokenAsync(string idToken)
|
async Task< FirebaseToken >
Parses and verifies a Firebase ID token.
|
VerifyIdTokenAsync(string idToken, CancellationToken cancellationToken)
|
async Task< FirebaseToken >
Parses and verifies a Firebase ID token.
|
VerifyIdTokenAsync(string idToken, bool checkRevoked)
|
async Task< FirebaseToken >
Parses and verifies a Firebase ID token.
|
VerifyIdTokenAsync(string idToken, bool checkRevoked, CancellationToken cancellationToken)
|
async Task< FirebaseToken >
Parses and verifies a Firebase ID token.
|
Protected functions |
|
---|---|
IfNotDeleted< TResult >(Func< TResult > func)
|
TResult
|
IsRevokedAsync(FirebaseToken token, CancellationToken cancellationToken)
|
async Task< bool >
|
Public functions
CreateCustomTokenAsync
async Task< string > CreateCustomTokenAsync( string uid )
Creates a Firebase custom token for the given user ID.
This token can then be sent back to a client application to be used with the signInWithCustomToken authentication API.
This method attempts to generate a token using:
- the private key of FirebaseApp's service account credentials, if provided at initialization.
- the IAM service if a service accound ID was specified via AppOptions
- the local metadata server if the code is deployed in a GCP-managed environment.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with a Firebase custom token.
|
CreateCustomTokenAsync
async Task< string > CreateCustomTokenAsync( string uid, CancellationToken cancellationToken )
Creates a Firebase custom token for the given user ID.
This token can then be sent back to a client application to be used with the signInWithCustomToken authentication API.
This method attempts to generate a token using:
- the private key of FirebaseApp's service account credentials, if provided at initialization.
- the IAM service if a service accound ID was specified via AppOptions
- the local metadata server if the code is deployed in a GCP-managed environment.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with a Firebase custom token.
|
CreateCustomTokenAsync
async Task< string > CreateCustomTokenAsync( string uid, IDictionary< string, object > developerClaims )
Creates a Firebase custom token for the given user ID containing the specified additional claims.
This token can then be sent back to a client application to be used with the signInWithCustomToken authentication API.
This method uses the same mechanisms as CreateCustomTokenAsync(string) to sign custom tokens.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with a Firebase custom token.
|
CreateCustomTokenAsync
async Task< string > CreateCustomTokenAsync( string uid, IDictionary< string, object > developerClaims, CancellationToken cancellationToken )
Creates a Firebase custom token for the given user ID containing the specified additional claims.
This token can then be sent back to a client application to be used with the signInWithCustomToken authentication API.
This method uses the same mechanisms as CreateCustomTokenAsync(string) to sign custom tokens.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with a Firebase custom token.
|
CreateProviderConfigAsync< T >
async Task< T > CreateProviderConfigAsync< T >( AuthProviderConfigArgs< T > args )
Creates a new auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Template Parameters |
|
||||
Returns |
A task that completes with an AuthProviderConfig.
|
CreateProviderConfigAsync< T >
async Task< T > CreateProviderConfigAsync< T >( AuthProviderConfigArgs< T > args, CancellationToken cancellationToken )
Creates a new auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Template Parameters |
|
||||
Returns |
A task that completes with an AuthProviderConfig.
|
CreateUserAsync
async Task< UserRecord > CreateUserAsync( UserRecordArgs args )
Creates a new user account with the attributes contained in the specified UserRecordArgs.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Exceptions |
|
||||||
Returns |
A task that completes with a UserRecord representing the newly created user account.
|
CreateUserAsync
async Task< UserRecord > CreateUserAsync( UserRecordArgs args, CancellationToken cancellationToken )
Creates a new user account with the attributes contained in the specified UserRecordArgs.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Exceptions |
|
||||||
Returns |
A task that completes with a UserRecord representing the newly created user account.
|
DeleteProviderConfigAsync
async Task DeleteProviderConfigAsync( string providerId )
Deletes the specified auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes when the provider configuration is deleted.
|
DeleteProviderConfigAsync
async Task DeleteProviderConfigAsync( string providerId, CancellationToken cancellationToken )
Deletes the specified auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes when the provider configuration is deleted.
|
DeleteUserAsync
async Task DeleteUserAsync( string uid )
Deletes the user identified by the specified uid .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes when the user account has been deleted.
|
DeleteUserAsync
async Task DeleteUserAsync( string uid, CancellationToken cancellationToken )
Deletes the user identified by the specified uid .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes when the user account has been deleted.
|
DeleteUsersAsync
async Task< DeleteUsersResult > DeleteUsersAsync( IReadOnlyList< string > uids )
Deletes the users specified by the given identifiers.
Deleting a non-existing user won't generate an error. (i.e. this method is idempotent.) Non-existing users will be considered to be successfully deleted, and will therefore be counted in the DeleteUserResult.SuccessCount
value.
A maximum of 1000 identifiers may be supplied. If more than 1000 identifiers are specified, this method throws an ArgumentException
.
This API is currently rate limited at the server to 1 QPS. If you exceed this, you may get a quota exceeded error. Therefore, if you want to delete more than 1000 users, you may need to add a delay to ensure you don't go over this limit.
Details | |||
---|---|---|---|
Parameters |
|
||
Exceptions |
|
||
Returns |
A task that resolves to the total number of successful/failed deletions, as well as the array of errors that correspond to the failed deletions.
|
DeleteUsersAsync
async Task< DeleteUsersResult > DeleteUsersAsync( IReadOnlyList< string > uids, CancellationToken cancellationToken )
Deletes the users specified by the given identifiers.
Deleting a non-existing user won't generate an error. (i.e. this method is idempotent.) Non-existing users will be considered to be successfully deleted, and will therefore be counted in the DeleteUserResult.SuccessCount
value.
A maximum of 1000 identifiers may be supplied. If more than 1000 identifiers are specified, this method throws an ArgumentException
.
This API is currently rate limited at the server to 1 QPS. If you exceed this, you may get a quota exceeded error. Therefore, if you want to delete more than 1000 users, you may need to add a delay to ensure you don't go over this limit.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that resolves to the total number of successful/failed deletions, as well as the array of errors that correspond to the failed deletions.
|
GenerateEmailVerificationLinkAsync
async Task< string > GenerateEmailVerificationLinkAsync( string email )
Generates the out-of-band email action link for email verification flows for the specified email address.
Details | |||
---|---|---|---|
Exceptions |
|
||
Parameters |
|
||
Returns |
A task that completes with the email verification link.
|
GenerateEmailVerificationLinkAsync
async Task< string > GenerateEmailVerificationLinkAsync( string email, ActionCodeSettings settings )
Generates the out-of-band email action link for email verification flows for the specified email address.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with the email verification link.
|
GenerateEmailVerificationLinkAsync
async Task< string > GenerateEmailVerificationLinkAsync( string email, ActionCodeSettings settings, CancellationToken cancellationToken )
Generates the out-of-band email action link for email verification flows for the specified email address.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with the email verification reset link.
|
GeneratePasswordResetLinkAsync
async Task< string > GeneratePasswordResetLinkAsync( string email )
Generates the out-of-band email action link for password reset flows for the specified email address.
Details | |||
---|---|---|---|
Exceptions |
|
||
Parameters |
|
||
Returns |
A task that completes with the password reset link.
|
GeneratePasswordResetLinkAsync
async Task< string > GeneratePasswordResetLinkAsync( string email, ActionCodeSettings settings )
Generates the out-of-band email action link for password reset flows for the specified email address.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with the password reset link.
|
GeneratePasswordResetLinkAsync
async Task< string > GeneratePasswordResetLinkAsync( string email, ActionCodeSettings settings, CancellationToken cancellationToken )
Generates the out-of-band email action link for password reset flows for the specified email address.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with the password reset link.
|
GenerateSignInWithEmailLinkAsync
async Task< string > GenerateSignInWithEmailLinkAsync( string email, ActionCodeSettings settings )
Generates the out-of-band email action link for email link sign-in flows for the specified email address.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with the email sign in link.
|
GenerateSignInWithEmailLinkAsync
async Task< string > GenerateSignInWithEmailLinkAsync( string email, ActionCodeSettings settings, CancellationToken cancellationToken )
Generates the out-of-band email action link for email link sign-in flows for the specified email address.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with the email sign in link.
|
GetOidcProviderConfigAsync
async Task< OidcProviderConfig > GetOidcProviderConfigAsync( string providerId )
Looks up an OIDC auth provider configuration by the provided ID.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a OidcProviderConfig.
|
GetOidcProviderConfigAsync
async Task< OidcProviderConfig > GetOidcProviderConfigAsync( string providerId, CancellationToken cancellationToken )
Looks up an OIDC auth provider configuration by the provided ID.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a OidcProviderConfig.
|
GetSamlProviderConfigAsync
async Task< SamlProviderConfig > GetSamlProviderConfigAsync( string providerId )
Looks up a SAML auth provider configuration by the provided ID.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a SamlProviderConfig.
|
GetSamlProviderConfigAsync
async Task< SamlProviderConfig > GetSamlProviderConfigAsync( string providerId, CancellationToken cancellationToken )
Looks up a SAML auth provider configuration by the provided ID.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a SamlProviderConfig.
|
GetUserAsync
async Task< UserRecord > GetUserAsync( string uid )
Gets a UserRecord object containing information about the user who's user ID was specified in uid .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified user ID.
|
GetUserAsync
async Task< UserRecord > GetUserAsync( string uid, CancellationToken cancellationToken )
Gets a UserRecord object containing information about the user who's user ID was specified in uid .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified user ID.
|
GetUserByEmailAsync
async Task< UserRecord > GetUserByEmailAsync( string email )
Gets a UserRecord object containing information about the user identified by email .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified email.
|
GetUserByEmailAsync
async Task< UserRecord > GetUserByEmailAsync( string email, CancellationToken cancellationToken )
Gets a UserRecord object containing information about the user identified by email .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified email.
|
GetUserByPhoneNumberAsync
async Task< UserRecord > GetUserByPhoneNumberAsync( string phoneNumber )
Gets a UserRecord object containing information about the user identified by phoneNumber .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified phone number.
|
GetUserByPhoneNumberAsync
async Task< UserRecord > GetUserByPhoneNumberAsync( string phoneNumber, CancellationToken cancellationToken )
Gets a UserRecord object containing information about the user identified by phoneNumber .
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes with a UserRecord representing a user with the specified phone number.
|
GetUsersAsync
async Task< GetUsersResult > GetUsersAsync( IReadOnlyCollection< UserIdentifier > identifiers )
Gets the user data corresponding to the specified identifiers.
There are no ordering guarantees; in particular, the nth entry in the users result list is not guaranteed to correspond to the nth entry in the input parameters list.
A maximum of 100 identifiers may be supplied. If more than 100 identifiers are specified, this method throws an ArgumentException
.
Details | |||
---|---|---|---|
Parameters |
|
||
Exceptions |
|
||
Returns |
A task that resolves to the corresponding user records.
|
GetUsersAsync
async Task< GetUsersResult > GetUsersAsync( IReadOnlyCollection< UserIdentifier > identifiers, CancellationToken cancellationToken )
Gets the user data corresponding to the specified identifiers.
There are no ordering guarantees; in particular, the nth entry in the users result list is not guaranteed to correspond to the nth entry in the input parameters list.
A maximum of 100 identifiers may be supplied. If more than 100 identifiers are specified, this method throws an ArgumentException
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that resolves to the corresponding user records.
|
ImportUsersAsync
async Task< UserImportResult > ImportUsersAsync( IEnumerable< ImportUserRecordArgs > users )
Imports the provided list of users into Firebase Auth.
You can import a maximum of 1000 users at a time. This operation is optimized for bulk imports and does not check identifier uniqueness, which could result in duplications.
UserImportOptions is required to import users with passwords. See FirebaseAuth.ImportUsersAsync.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A UserImportResult instance.
|
ImportUsersAsync
async Task< UserImportResult > ImportUsersAsync( IEnumerable< ImportUserRecordArgs > users, CancellationToken cancellationToken )
Imports the provided list of users into Firebase Auth.
You can import a maximum of 1000 users at a time. This operation is optimized for bulk imports and does not check identifier uniqueness, which could result in duplications.
UserImportOptions is required to import users with passwords. See FirebaseAuth.ImportUsersAsync.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A UserImportResult instance.
|
ImportUsersAsync
async Task< UserImportResult > ImportUsersAsync( IEnumerable< ImportUserRecordArgs > users, UserImportOptions options )
Imports the provided list of users into Firebase Auth.
You can import a maximum of 1000 users at a time. This operation is optimized for bulk imports and does not check identifier uniqueness, which could result in duplications.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A UserImportResult instance.
|
ImportUsersAsync
async Task< UserImportResult > ImportUsersAsync( IEnumerable< ImportUserRecordArgs > users, UserImportOptions options, CancellationToken cancellationToken )
Imports the provided list of users into Firebase Auth.
You can import a maximum of 1000 users at a time. This operation is optimized for bulk imports and does not check identifier uniqueness, which could result in duplications.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Exceptions |
|
||||||
Returns |
A UserImportResult instance.
|
ListOidcProviderConfigsAsync
PagedAsyncEnumerable< AuthProviderConfigs< OidcProviderConfig >, OidcProviderConfig > ListOidcProviderConfigsAsync( ListProviderConfigsOptions options )
Gets an async enumerable to iterate or page through OIDC provider configurations 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 |
|
||
Returns |
A PagedAsyncEnumerable{AuthProviderConfigs, OidcProviderConfig} instance.
|
ListSamlProviderConfigsAsync
PagedAsyncEnumerable< AuthProviderConfigs< SamlProviderConfig >, SamlProviderConfig > ListSamlProviderConfigsAsync( ListProviderConfigsOptions options )
Gets an async enumerable to iterate or page through SAML provider configurations 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 |
|
||
Returns |
A PagedAsyncEnumerable{AuthProviderConfigs, SamlProviderConfig} instance.
|
ListUsersAsync
PagedAsyncEnumerable< ExportedUserRecords, ExportedUserRecord > ListUsersAsync( ListUsersOptions options )
Gets an async enumerable to iterate or page through users 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 |
|
||
Returns |
A PagedAsyncEnumerable{ExportedUserRecords, ExportedUserRecord} instance.
|
RevokeRefreshTokensAsync
async Task RevokeRefreshTokensAsync( string uid )
Revokes all refresh tokens for the specified user.
Updates the user's tokensValidAfterTimestamp
to the current UTC time expressed in seconds since the epoch and truncated to 1 second accuracy. It is important that the server on which this is called has its clock set correctly and synchronized.
While this will revoke all sessions for a specified user and disable any new ID tokens for existing sessions from getting minted, existing ID tokens may remain active until their natural expiration (one hour).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes when the user's refresh tokens have been revoked.
|
RevokeRefreshTokensAsync
async Task RevokeRefreshTokensAsync( string uid, CancellationToken cancellationToken )
Revokes all refresh tokens for the specified user.
Updates the user's tokensValidAfterTimestamp
to the current UTC time expressed in seconds since the epoch and truncated to 1 second accuracy. It is important that the server on which this is called has its clock set correctly and synchronized.
While this will revoke all sessions for a specified user and disable any new ID tokens for existing sessions from getting minted, existing ID tokens may remain active until their natural expiration (one hour).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Exceptions |
|
||||
Returns |
A task that completes when the user's refresh tokens have been revoked.
|
SetCustomUserClaimsAsync
async Task SetCustomUserClaimsAsync( string uid, IReadOnlyDictionary< string, object > claims )
Sets the specified custom claims on an existing user account.
A null claims value removes any claims currently set on the user account. The claims must serialize into a valid JSON string. The serialized claims must not be larger than 1000 characters.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes when the claims have been set.
|
SetCustomUserClaimsAsync
async Task SetCustomUserClaimsAsync( string uid, IReadOnlyDictionary< string, object > claims, CancellationToken cancellationToken )
Sets the specified custom claims on an existing user account.
A null claims value removes any claims currently set on the user account. The claims should serialize into a valid JSON string. The serialized claims must not be larger than 1000 characters.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes when the claims have been set.
|
UpdateProviderConfigAsync< T >
async Task< T > UpdateProviderConfigAsync< T >( AuthProviderConfigArgs< T > args )
Updates an existing auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Template Parameters |
|
||||
Returns |
A task that completes with the updated AuthProviderConfig.
|
UpdateProviderConfigAsync< T >
async Task< T > UpdateProviderConfigAsync< T >( AuthProviderConfigArgs< T > args, CancellationToken cancellationToken )
Updates an existing auth provider configuration.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Template Parameters |
|
||||
Returns |
A task that completes with the updated AuthProviderConfig.
|
UpdateUserAsync
async Task< UserRecord > UpdateUserAsync( UserRecordArgs args )
Updates an existing user account with the attributes contained in the specified UserRecordArgs.
The UserRecordArgs.Uid property must be specified.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Exceptions |
|
||||||
Returns |
A task that completes with a UserRecord representing the updated user account.
|
UpdateUserAsync
async Task< UserRecord > UpdateUserAsync( UserRecordArgs args, CancellationToken cancellationToken )
Updates an existing user account with the attributes contained in the specified UserRecordArgs.
The UserRecordArgs.Uid property must be specified.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Exceptions |
|
||||||
Returns |
A task that completes with a UserRecord representing the updated user account.
|
VerifyIdTokenAsync
async Task< FirebaseToken > VerifyIdTokenAsync( string idToken )
Parses and verifies a Firebase ID token.
A Firebase client app can identify itself to a trusted backend server by sending its Firebase ID Token (accessible via the getIdToken()
API in the Firebase client SDK) with its requests. The backend server can then use this method to verify that the token is valid. This method ensures that the token is correctly signed, has not expired, and it was issued against the Firebase project associated with this FirebaseAuth
instance.
See Verify ID Tokens for code samples and detailed documentation.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a FirebaseToken representing the verified and decoded ID token.
|
VerifyIdTokenAsync
async Task< FirebaseToken > VerifyIdTokenAsync( string idToken, CancellationToken cancellationToken )
Parses and verifies a Firebase ID token.
A Firebase client app can identify itself to a trusted backend server by sending its Firebase ID Token (accessible via the getIdToken()
API in the Firebase client SDK) with its requests. The backend server can then use this method to verify that the token is valid. This method ensures that the token is correctly signed, has not expired, and it was issued against the Firebase project associated with this FirebaseAuth
instance.
See Verify ID Tokens for code samples and detailed documentation.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a FirebaseToken representing the verified and decoded ID token.
|
VerifyIdTokenAsync
async Task< FirebaseToken > VerifyIdTokenAsync( string idToken, bool checkRevoked )
Parses and verifies a Firebase ID token.
A Firebase client app can identify itself to a trusted backend server by sending its Firebase ID Token (accessible via the getIdToken()
API in the Firebase client SDK) with its requests. The backend server can then use this method to verify that the token is valid. This method ensures that the token is correctly signed, has not expired, and it was issued against the Firebase project associated with this FirebaseAuth
instance.
If checkRevoked
is set to true, this method performs an additional check to see if the ID token has been revoked since it was issued. This requires making an additional remote API call.
See Verify ID Tokens for code samples and detailed documentation.
Details | |||||
---|---|---|---|---|---|
Exceptions |
|
||||
Parameters |
|
||||
Returns |
A task that completes with a FirebaseToken representing the verified and decoded ID token.
|
VerifyIdTokenAsync
async Task< FirebaseToken > VerifyIdTokenAsync( string idToken, bool checkRevoked, CancellationToken cancellationToken )
Parses and verifies a Firebase ID token.
A Firebase client app can identify itself to a trusted backend server by sending its Firebase ID Token (accessible via the getIdToken()
API in the Firebase client SDK) with its requests. The backend server can then use this method to verify that the token is valid. This method ensures that the token is correctly signed, has not expired, and it was issued against the Firebase project associated with this FirebaseAuth
instance.
If checkRevoked
is set to true, this method performs an additional check to see if the ID token has been revoked since it was issued. This requires making an additional remote API call.
See Verify ID Tokens for code samples and detailed documentation.
Details | |||||||
---|---|---|---|---|---|---|---|
Exceptions |
|
||||||
Parameters |
|
||||||
Returns |
A task that completes with a FirebaseToken representing the verified and decoded ID token.
|
Protected functions
IfNotDeleted< TResult >
TResult IfNotDeleted< TResult >( Func< TResult > func )
IsRevokedAsync
async Task< bool > IsRevokedAsync( FirebaseToken token, CancellationToken cancellationToken )