FirebaseAuth Framework Reference

User

Represents a user.

Firebase Auth does not attempt to validate userswhen loading them from the keychain. Invalidated users (such as thosewhose passwords have been changed on another client) are automaticallylogged out when an auth-dependent operation is attempted or when theID token is automatically refreshed.

This class is thread-safe.

  • Indicates the user represents an anonymous user.

    Declaration

    Swift

    @objcpublicinternal(set)varisAnonymous:Bool{get}
  • Indicates the user represents an anonymous user.

    Declaration

    Swift

    @objcopenfuncanonymous()->Bool
  • Indicates the email address associated with this user has been verified.

    Declaration

    Swift

    @objcpublicprivate(set)varisEmailVerified:Bool{get}
  • Indicates the email address associated with this user has been verified.

    Declaration

    Swift

    @objcopenfuncemailVerified()->Bool
  • Profile data for each identity provider, if any.

    This data is cached on sign-in and updated when linking or unlinking.

    Declaration

    Swift

    @objcopenvarproviderData:[UserInfo]{get}
  • Metadata associated with the Firebase user in question.

    Declaration

    Swift

    @objcpublicprivate(set)varmetadata:UserMetadata{get}
  • The tenant ID of the current user.nil if none is available.

    Declaration

    Swift

    @objcpublicprivate(set)vartenantID:String?{get}
  • Multi factor object associated with the user.

    This property is available on iOS and macOS.

    Declaration

    Swift

    @objcpublicprivate(set)varmultiFactor:MultiFactor{get}
  • [Deprecated] Updates the email address for the user.

    On success, the cached user profile data is updated. Returns an error whenEmail Enumeration Protectionis enabled.

    May fail if there is already an account with this email address that was created usingemail and password authentication.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email wassent in the request.
    • AuthErrorCodeInvalidSender - Indicates an invalid sender email is set inthe console for this action.
    • AuthErrorCodeInvalidMessagePayload - Indicates an invalid email template forsending update email.
    • AuthErrorCodeEmailAlreadyInUse - Indicates the email is already in use by anotheraccount.
    • AuthErrorCodeInvalidEmail - Indicates the email address is malformed.
    • AuthErrorCodeRequiresRecentLogin - Updating a user’s email is a securitysensitive operation that requires a recent login from the user. This error indicatesthe user has not signed in recently enough. To resolve, reauthenticate the user bycallingreauthenticate(with:).

    Declaration

    Swift

    @available(*,deprecated,message:"`updateEmail` is deprecated and will be removed in a future release. Use sendEmailVerification(beforeUpdatingEmail:﹚ instead.")@objc(updateEmail:completion:)openfuncupdateEmail(toemail:String,completion:((Error?)->Void)?=nil)

    Parameters

    email

    The email address for the user.

    completion

    Optionally; the block invoked when the user profile change hasfinished.

  • [Deprecated] Updates the email address for the user.

    On success, the cached user profile data is updated. Throws whenEmail Enumeration Protectionis enabled.

    May fail if there is already an account with this email address that was created usingemail and password authentication.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email wassent in the request.
    • AuthErrorCodeInvalidSender - Indicates an invalid sender email is set inthe console for this action.
    • AuthErrorCodeInvalidMessagePayload - Indicates an invalid email template forsending update email.
    • AuthErrorCodeEmailAlreadyInUse - Indicates the email is already in use by anotheraccount.
    • AuthErrorCodeInvalidEmail - Indicates the email address is malformed.
    • AuthErrorCodeRequiresRecentLogin - Updating a user’s email is a securitysensitive operation that requires a recent login from the user. This error indicatesthe user has not signed in recently enough. To resolve, reauthenticate the user bycallingreauthenticate(with:).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@available(*,deprecated,message:"`updateEmail` is deprecated and will be removed in a future release. Use sendEmailVerification(beforeUpdatingEmail:﹚ instead.")openfuncupdateEmail(toemail:String)asyncthrows

    Parameters

    email

    The email address for the user.

  • Updates the password for the user. On success, the cached user profile data is updated.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeOperationNotAllowed - Indicates the administrator disabled sign in with the specified identity provider.
    • AuthErrorCodeRequiresRecentLogin - Updating a user’s password is a security sensitive operation that requires a recent login from the user. This error indicates the user has not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).
    • AuthErrorCodeWeakPassword - Indicates an attempt to set a password that isconsidered too weak. TheNSLocalizedFailureReasonErrorKey field in theuserInfodictionary object will contain more detailed explanation that can be shown to the user.

    Declaration

    Swift

    @objc(updatePassword:completion:)openfuncupdatePassword(topassword:String,completion:((Error?)->Void)?=nil)

    Parameters

    password

    The new password for the user.

    completion

    Optionally; the block invoked when the user profile change hasfinished.

  • Updates the password for the user. On success, the cached user profile data is updated.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeOperationNotAllowed - Indicates the administrator disabled sign in with the specified identity provider.
    • AuthErrorCodeRequiresRecentLogin - Updating a user’s password is a security sensitive operation that requires a recent login from the user. This error indicates the user has not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).
    • AuthErrorCodeWeakPassword - Indicates an attempt to set a password that isconsidered too weak. TheNSLocalizedFailureReasonErrorKey field in theuserInfodictionary object will contain more detailed explanation that can be shown to the user.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncupdatePassword(topassword:String)asyncthrows

    Parameters

    password

    The new password for the user.

  • Updates the phone number for the user. On success, the cached user profile data is updated.

    Invoked asynchronously on the main thread in the future.

    This method is available on iOS only.

    Possible error codes:

    • AuthErrorCodeRequiresRecentLogin - Updating a user’s phone number is a securitysensitive operation that requires a recent login from the user. This error indicatesthe user has not signed in recently enough. To resolve, reauthenticate the user bycallingreauthenticate(with:).

    Declaration

    Swift

    @objc(updatePhoneNumberCredential:completion:)openfuncupdatePhoneNumber(_credential:PhoneAuthCredential,completion:((Error?)->Void)?=nil)

    Parameters

    credential

    The new phone number credential corresponding to thephone number to be added to the Firebase account, if a phone number is already linked to theaccount this new phone number will replace it.

    completion

    Optionally; the block invoked when the user profile change hasfinished.

  • Updates the phone number for the user. On success, the cached user profile data is updated.

    Invoked asynchronously on the main thread in the future.

    This method is available on iOS only.

    Possible error codes:

    • AuthErrorCodeRequiresRecentLogin - Updating a user’s phone number is a securitysensitive operation that requires a recent login from the user. This error indicatesthe user has not signed in recently enough. To resolve, reauthenticate the user bycallingreauthenticate(with:).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncupdatePhoneNumber(_credential:PhoneAuthCredential)asyncthrows

    Parameters

    credential

    The new phone number credential corresponding to thephone number to be added to the Firebase account, if a phone number is already linked to theaccount this new phone number will replace it.

  • Creates an object which may be used to change the user’s profile data.

    Set the properties of the returned object, then callUserProfileChangeRequest.commitChanges() to perform the updates atomically.

    Declaration

    Swift

    @objc(profileChangeRequest)openfunccreateProfileChangeRequest()->UserProfileChangeRequest

    Return Value

    An object which may be used to change the user’s profile data atomically.

  • A refresh token; useful for obtaining new access tokens independently.

    This property should only be used for advanced scenarios, and is not typically needed.

    Declaration

    Swift

    @objcopenvarrefreshToken:String?{get}
  • Reloads the user’s profile data from the server.

    May fail with anAuthErrorCodeRequiresRecentLogin error code. In this caseyou should callreauthenticate(with:) before re-invokingupdateEmail(to:).

    Declaration

    Swift

    @objcopenfuncreload(completion:((Error?)->Void)?=nil)

    Parameters

    completion

    Optionally; the block invoked when the reload has finished. Invokedasynchronously on the main thread in the future.

  • Reloads the user’s profile data from the server.

    May fail with anAuthErrorCodeRequiresRecentLogin error code. In this caseyou should callreauthenticate(with:) before re-invokingupdateEmail(to:).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncreload()asyncthrows
  • Renews the user’s authentication tokens by validating a fresh set of credentials suppliedby the user and returns additional identity provider data.

    If the user associated with the supplied credential is different from the current user,or if the validation of the supplied credentials fails; an error is returned and the currentuser remains signed in.

    Possible error codes:

    • AuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid.This could happen if it has expired or it is malformed.
    • AuthErrorCodeOperationNotAllowed - Indicates that accounts with theidentity provider represented by the credential are not enabled. Enable them in theAuth section of the Firebase console.
    • AuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential(e.g. the email in a Facebook access token) is already in use by an existing account,that cannot be authenticated with this method. This error will only be thrown if the“One account per email address” setting is enabled in the Firebase console, under Authsettings. Please note that the error code raised in this specific situation may not bethe same on Web and Android.
    • AuthErrorCodeUserDisabled - Indicates the user’s account is disabled.
    • AuthErrorCodeWrongPassword - Indicates the user attempted reauthentication withan incorrect password, if credential is of the typeEmailPasswordAuthCredential.
    • AuthErrorCodeUserMismatch - Indicates that an attempt was made toreauthenticate with a user which is not the current user.
    • AuthErrorCodeInvalidEmail - Indicates the email address is malformed.

    Declaration

    Swift

    @objc(reauthenticateWithCredential:completion:)openfuncreauthenticate(withcredential:AuthCredential,completion:((AuthDataResult?,Error?)->Void)?=nil)

    Parameters

    credential

    A user-supplied credential, which will be validated by the server.This can be a successful third-party identity provider sign-in, or an email address andpassword.

    completion

    Optionally; the block invoked when the re-authentication operation hasfinished. Invoked asynchronously on the main thread in the future.

  • Renews the user’s authentication tokens by validating a fresh set of credentials suppliedby the user and returns additional identity provider data.

    If the user associated with the supplied credential is different from the current user,or if the validation of the supplied credentials fails; an error is returned and the currentuser remains signed in.

    Possible error codes:

    • AuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid.This could happen if it has expired or it is malformed.
    • AuthErrorCodeOperationNotAllowed - Indicates that accounts with theidentity provider represented by the credential are not enabled. Enable them in theAuth section of the Firebase console.
    • AuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential(e.g. the email in a Facebook access token) is already in use by an existing account,that cannot be authenticated with this method. This error will only be thrown if the“One account per email address” setting is enabled in the Firebase console, under Authsettings. Please note that the error code raised in this specific situation may not bethe same on Web and Android.
    • AuthErrorCodeUserDisabled - Indicates the user’s account is disabled.
    • AuthErrorCodeWrongPassword - Indicates the user attempted reauthentication withan incorrect password, if credential is of the typeEmailPasswordAuthCredential.
    • AuthErrorCodeUserMismatch - Indicates that an attempt was made toreauthenticate with a user which is not the current user.
    • AuthErrorCodeInvalidEmail - Indicates the email address is malformed.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@discardableResultopenfuncreauthenticate(withcredential:AuthCredential)asyncthrows->AuthDataResult

    Parameters

    credential

    A user-supplied credential, which will be validated by the server.This can be a successful third-party identity provider sign-in, or an email address andpassword.

    Return Value

    TheAuthDataResult after the reauthentication.

  • Renews the user’s authentication using the provided auth provider instance.

    This method is available on iOS only.

    Declaration

    Swift

    @objc(reauthenticateWithProvider:UIDelegate:completion:)openfuncreauthenticate(withprovider:FederatedAuthProvider,uiDelegate:AuthUIDelegate?,completion:((AuthDataResult?,Error?)->Void)?=nil)

    Parameters

    provider

    An instance of an auth provider used to initiate the reauthenticateflow.

    uiDelegate

    Optionally an instance of a class conforming to theAuthUIDelegateprotocol, used for presenting the web context. If nil, a defaultAuthUIDelegatewill be used.

    completion

    Optionally; a block which is invoked when the reauthenticate flowfinishes, or is canceled. Invoked asynchronously on the main thread in the future.

  • Renews the user’s authentication using the provided auth provider instance.

    This method is available on iOS only.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@discardableResultopenfuncreauthenticate(withprovider:FederatedAuthProvider,uiDelegate:AuthUIDelegate?)asyncthrows->AuthDataResult

    Parameters

    provider

    An instance of an auth provider used to initiate the reauthenticateflow.

    uiDelegate

    Optionally an instance of a class conforming to theAuthUIDelegateprotocol, used for presenting the web context. If nil, a defaultAuthUIDelegatewill be used.

    Return Value

    TheAuthDataResult after the reauthentication.

  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    Declaration

    Swift

    @objc(getIDTokenWithCompletion:)openfuncgetIDToken(completion:((String?,Error?)->Void)?)

    Parameters

    completion

    Optionally; the block invoked when the token is available. Invokedasynchronously on the main thread in the future.

  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    The authentication token will be refreshed (by making a network request) if it hasexpired, or ifforceRefresh istrue.

    Declaration

    Swift

    @objc(getIDTokenForcingRefresh:completion:)openfuncgetIDTokenForcingRefresh(_forceRefresh:Bool,completion:((String?,Error?)->Void)?)

    Parameters

    forceRefresh

    Forces a token refresh. Useful if the token becomes invalid for somereason other than an expiration.

    completion

    Optionally; the block invoked when the token is available. Invokedasynchronously on the main thread in the future.

  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    The authentication token will be refreshed (by making a network request) if it hasexpired, or ifforceRefresh istrue.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncgetIDToken(forcingRefreshforceRefresh:Bool=false)asyncthrows->String

    Parameters

    forceRefresh

    Forces a token refresh. Useful if the token becomes invalid for somereason other than an expiration.

    Return Value

    The Firebase authentication token.

  • API included for compatibility with a mis-named Firebase 10 API.UsegetIDToken(forcingRefresh forceRefresh: Bool = false) instead.

    Declaration

    Swift

    openfuncidTokenForcingRefresh(_forceRefresh:Bool)asyncthrows->String
  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    Declaration

    Swift

    @objc(getIDTokenResultWithCompletion:)openfuncgetIDTokenResult(completion:((AuthTokenResult?,Error?)->Void)?)

    Parameters

    completion

    Optionally; the block invoked when the token is available. Invokedasynchronously on the main thread in the future.

  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    The authentication token will be refreshed (by making a network request) if it hasexpired, or ifforcingRefresh istrue.

    Declaration

    Swift

    @objc(getIDTokenResultForcingRefresh:completion:)openfuncgetIDTokenResult(forcingRefresh:Bool,completion:((AuthTokenResult?,Error?)->Void)?)

    Parameters

    forcingRefresh

    Forces a token refresh. Useful if the token becomes invalid forsomereason other than an expiration.

    completion

    Optionally; the block invoked when the token is available. Invokedasynchronously on the main thread in the future.

  • Retrieves the Firebase authentication token, possibly refreshing it if it has expired.

    The authentication token will be refreshed (by making a network request) if it hasexpired, or ifforceRefresh istrue.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncgetIDTokenResult(forcingRefreshforceRefresh:Bool=false)asyncthrows->AuthTokenResult

    Parameters

    forceRefresh

    Forces a token refresh. Useful if the token becomes invalid for somereason other than an expiration.

    Return Value

    The Firebase authentication token.

  • Associates a user account from a third-party identity provider with this user and returns additional identity provider data.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeProviderAlreadyLinked - Indicates an attempt to link a provider of atype already linked to this account.
    • AuthErrorCodeCredentialAlreadyInUse - Indicates an attempt to link with acredential that has already been linked with a different Firebase account.
    • AuthErrorCodeOperationNotAllowed - Indicates that accounts with the identityprovider represented by the credential are not enabled. Enable them in the Auth sectionof the Firebase console.

    This method may also return error codes associated withupdateEmail(to:) andupdatePassword(to:) onUser.

    Declaration

    Swift

    @objc(linkWithCredential:completion:)openfunclink(withcredential:AuthCredential,completion:((AuthDataResult?,Error?)->Void)?=nil)

    Parameters

    credential

    The credential for the identity provider.

    completion

    Optionally; the block invoked when the unlinking is complete, orfails.

  • Associates a user account from a third-party identity provider with this user andreturns additional identity provider data.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeProviderAlreadyLinked - Indicates an attempt to link a provider of atype already linked to this account.
    • AuthErrorCodeCredentialAlreadyInUse - Indicates an attempt to link with acredential that has already been linked with a different Firebase account.
    • AuthErrorCodeOperationNotAllowed - Indicates that accounts with the identityprovider represented by the credential are not enabled. Enable them in the Auth sectionof the Firebase console.

    This method may also return error codes associated withupdateEmail(to:) andupdatePassword(to:) onUser.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@discardableResultopenfunclink(withcredential:AuthCredential)asyncthrows->AuthDataResult

    Parameters

    credential

    The credential for the identity provider.

    Return Value

    AnAuthDataResult.

  • Link the user with the provided auth provider instance.

    This method is available on iOSonly.

    Declaration

    Swift

    @objc(linkWithProvider:UIDelegate:completion:)openfunclink(withprovider:FederatedAuthProvider,uiDelegate:AuthUIDelegate?,completion:((AuthDataResult?,Error?)->Void)?=nil)

    Parameters

    provider

    An instance of an auth provider used to initiate the link flow.

    uiDelegate

    Optionally an instance of a class conforming to theAuthUIDelegateprotocol used for presenting the web context. If nil, a defaultAuthUIDelegate will beused.

    completion

    Optionally; a block which is invoked when the link flow finishes, oris canceled. Invoked asynchronously on the main thread in the future.

  • Link the user with the provided auth provider instance.

    This method is available on iOSonly.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)@discardableResultopenfunclink(withprovider:FederatedAuthProvider,uiDelegate:AuthUIDelegate?)asyncthrows->AuthDataResult

    Parameters

    provider

    An instance of an auth provider used to initiate the link flow.

    uiDelegate

    Optionally an instance of a class conforming to theAuthUIDelegateprotocol used for presenting the web context. If nil, a defaultAuthUIDelegatewill be used.

    Return Value

    An AuthDataResult.

  • Disassociates a user account from a third-party identity provider with this user.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeNoSuchProvider - Indicates an attempt to unlink a providerthat is not linked to the account.
    • AuthErrorCodeRequiresRecentLogin - Updating email is a security sensitiveoperation that requires a recent login from the user. This error indicates the userhas not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).

    Declaration

    Swift

    @objcopenfuncunlink(fromProviderprovider:String,completion:((User?,Error?)->Void)?=nil)

    Parameters

    provider

    The provider ID of the provider to unlink.

    completion

    Optionally; the block invoked when the unlinking is complete, orfails.

  • Disassociates a user account from a third-party identity provider with this user.

    Invoked asynchronously on the main thread in the future.

    Possible error codes:

    • AuthErrorCodeNoSuchProvider - Indicates an attempt to unlink a providerthat is not linked to the account.
    • AuthErrorCodeRequiresRecentLogin - Updating email is a security sensitiveoperation that requires a recent login from the user. This error indicates the userhas not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncunlink(fromProviderprovider:String)asyncthrows->User

    Parameters

    provider

    The provider ID of the provider to unlink.

    Return Value

    The user.

  • Initiates email verification for the user.

    Possible error codes:

    • AuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email wassent in the request.
    • AuthErrorCodeInvalidSender - Indicates an invalid sender email is set inthe console for this action.
    • AuthErrorCodeInvalidMessagePayload - Indicates an invalid email template forsending update email.
    • AuthErrorCodeUserNotFound - Indicates the user account was not found.

    Declaration

    Swift

    @objc(sendEmailVerificationWithCompletion:)openfunc__sendEmailVerification(withCompletioncompletion:((Error?)->Void)?)

    Parameters

    completion

    Optionally; the block invoked when the request to send an emailverification is complete, or fails. Invoked asynchronously on the main thread in the future.

  • Initiates email verification for the user.

    Possible error codes:

    • AuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email wassent in the request.
    • AuthErrorCodeInvalidSender - Indicates an invalid sender email is set inthe console for this action.
    • AuthErrorCodeInvalidMessagePayload - Indicates an invalid email template forsending update email.
    • AuthErrorCodeUserNotFound - Indicates the user account was not found.

    Declaration

    Swift

    @objc(sendEmailVerificationWithActionCodeSettings:completion:)openfuncsendEmailVerification(withactionCodeSettings:ActionCodeSettings?=nil,completion:((Error?)->Void)?=nil)

    Parameters

    actionCodeSettings

    AnActionCodeSettings object containing settings related tohandling action codes.

    completion

    Optionally; the block invoked when the request to send an emailverification is complete, or fails. Invoked asynchronously on the main thread in the future.

  • Initiates email verification for the user.

    Possible error codes:

    • AuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email wassent in the request.
    • AuthErrorCodeInvalidSender - Indicates an invalid sender email is set inthe console for this action.
    • AuthErrorCodeInvalidMessagePayload - Indicates an invalid email template forsending update email.
    • AuthErrorCodeUserNotFound - Indicates the user account was not found.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncsendEmailVerification(withactionCodeSettings:ActionCodeSettings?=nil)asyncthrows

    Parameters

    actionCodeSettings

    AnActionCodeSettings object containing settings related tohandling action codes. The default value isnil.

  • Deletes the user account (also signs out the user, if this was the current user).

    Possible error codes:

    • AuthErrorCodeRequiresRecentLogin - Updating email is a security sensitiveoperation that requires a recent login from the user. This error indicates the userhas not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).

    Declaration

    Swift

    @objcopenfuncdelete(completion:((Error?)->Void)?=nil)

    Parameters

    completion

    Optionally; the block invoked when the request to delete the accountis complete, or fails. Invoked asynchronously on the main thread in the future.

  • Deletes the user account (also signs out the user, if this was the current user).

    Possible error codes:

    • AuthErrorCodeRequiresRecentLogin - Updating email is a security sensitiveoperation that requires a recent login from the user. This error indicates the userhas not signed in recently enough. To resolve, reauthenticate the user by callingreauthenticate(with:).

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncdelete()asyncthrows
  • Send an email to verify the ownership of the account then update to the new email.

    Declaration

    Swift

    @objc(sendEmailVerificationBeforeUpdatingEmail:completion:)openfunc__sendEmailVerificationBeforeUpdating(email:String,completion:((Error?)->Void)?)

    Parameters

    email

    The email to be updated to.

    completion

    Optionally; the block invoked when the request to send theverification email is complete, or fails.

  • Send an email to verify the ownership of the account then update to the new email.

    Declaration

    Swift

    @objcopenfuncsendEmailVerification(beforeUpdatingEmailemail:String,actionCodeSettings:ActionCodeSettings?=nil,completion:((Error?)->Void)?=nil)

    Parameters

    email

    The email to be updated to.

    actionCodeSettings

    AnActionCodeSettings object containing settings related tohandling action codes.

    completion

    Optionally; the block invoked when the request to send theverification email is complete, or fails.

  • Send an email to verify the ownership of the account then update to the new email.

    Declaration

    Swift

    @available(iOS13,tvOS13,macOS10.15,watchOS7,*)openfuncsendEmailVerification(beforeUpdatingEmailnewEmail:String,actionCodeSettings:ActionCodeSettings?=nil)asyncthrows

    Parameters

    newEmail

    The email to be updated to.

    actionCodeSettings

    AnActionCodeSettings object containing settings related tohandling action codes.

  • Declaration

    Swift

    openvarproviderID:String{get}
  • The provider’s user ID for the user.

    Declaration

    Swift

    openvaruid:String
  • The name of the user.

    Declaration

    Swift

    openvardisplayName:String?
  • The URL of the user’s profile photo.

    Declaration

    Swift

    openvarphotoURL:URL?
  • The user’s email address.

    Declaration

    Swift

    openvaremail:String?
  • A phone number associated with the user.

    This property is only available for users authenticated via phone number auth.

    Declaration

    Swift

    openvarphoneNumber:String?
  • Undocumented

    Declaration

    Swift

    publicstaticletsupportsSecureCoding:Bool
  • Undocumented

    Declaration

    Swift

    publicfuncencode(withcoder:NSCoder)
  • Undocumented

    Declaration

    Swift

    publicrequiredinit?(coder:NSCoder)

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-27 UTC.