Handle Firebase Apple Platforms Auth Errors Stay organized with collections Save and categorize content based on your preferences.
If the completion callback onAuthentication methods receives anNSError argument thatis not nil, an error has occurred. To dispatch to appropriate error-handlinglogic in your production code, check the error code against common errors andmethod specific errors listed below.
Some errors can be resolved by particular user actions, for example,FIRAuthErrorCodeUserTokenExpired can be resolved by signing the user inagain, andFIRAuthErrorCodeWrongPassword by asking the user to provide theright password.
Except in the case ofFIRAuthErrorCodeNetworkError orFIRAuthErrorCodeTooManyRequests, retrying a failing operation with the samearguments will never succeed. Make no assumption on whether or not the operationhas taken effect on the server side.
When investigating or logging errors, review theuserInfo dictionary.FIRAuthErrorNameKey contains a cross-platform error name string that can beused for identifying the error.NSLocalizedDescriptionKey contains a description of the error. Thisdescription is meant for the developer, not the user.NSUnderlyingErrorKey contains the underlying error that caused the error inquestion, if an underlying error is present.
In addition to the main fields listed above, there can be other fields in theuserInfo dictionary that you may find useful when diagnosing errors.
Error codes common to all API methods
Code
Meaning
FIRAuthErrorCodeNetworkError
Indicates a network error occurred during the operation.
FIRAuthErrorCodeUserNotFound
Indicates the user account was not found. This could happen if the user account has been deleted.
FIRAuthErrorCodeUserTokenExpired
Indicates the current user’s token has expired, for example, the user may have changed account password on another device. You must prompt the user to sign in again on this device.
FIRAuthErrorCodeTooManyRequests
Indicates that the request has been blocked after an abnormal number of requests have been made from the caller device to theFirebase Authentication servers. Retry again after some time.
FIRAuthErrorCodeInvalidAPIKey
Indicates the application has been configured with an invalid API key.
FIRAuthErrorCodeAppNotAuthorized
Indicates the App is not authorized to use Firebase Authentication with the provided API Key. go to the Google API Console and check under the credentials tab that the API key you are using has your application’s bundle ID whitelisted.
FIRAuthErrorCodeKeychainError
Indicates an error occurred when accessing the keychain. TheNSLocalizedFailureReasonErrorKey andNSUnderlyingErrorKey fields in theNSError.userInfo dictionary will contain more information about the error encountered.
FIRAuthErrorCodeInternalError
Indicates an internal error occurred. Pleasereport the error with the entireNSError object.
Method specific error codes
FIRAuth
fetchProvidersForEmail:completion:
Code
Meaning
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed.
signInWithEmail:password:completion:
Code
Meaning
FIRAuthErrorCodeOperationNotAllowed
Indicates that email and password accounts are not enabled. Enable them in the Auth section of theFirebase console.
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed.
FIRAuthErrorCodeUserDisabled
Indicates the user's account is disabled.
FIRAuthErrorCodeWrongPassword
Indicates the user attempted sign in with a wrong password.
signInWithCredential:completion:
Code
Meaning
FIRAuthErrorCodeInvalidCredential
Indicates the supplied credential is invalid. This could happen if it has expired or it is malformed.
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed, if credential is of the typeEmailPasswordAuthCredential.
FIRAuthErrorCodeOperationNotAllowed
Indicates that accounts with the identity provider represented by the credential are not enabled. Enable them in the Auth section of theFirebase console.
FIRAuthErrorCodeEmailAlreadyInUse
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 sign-in method. CallfetchProvidersForEmail for this user’s email and then prompt them to sign in with any of the sign-in providers returned. This error will only be thrown if the "One account per email address" setting is enabled in theFirebase console, underAuthentication settings.
FIRAuthErrorCodeUserDisabled
Indicates the user's account is disabled.
FIRAuthErrorCodeWrongPassword
Indicates the user attempted sign in with a wrong password, if credential is of the typeEmailPasswordAuthCredential.
signInAnonymouslyWithCompletion:
Code
Meaning
FIRAuthErrorCodeOperationNotAllowed
Indicates that anonymous accounts are not enabled. Enable them in the Auth section of theFirebase console.
signInWithCustomToken:completion:
Code
Meaning
FIRAuthErrorCodeInvalidCustomToken
Indicates a validation error with the custom token.
FIRAuthErrorCodeCustomTokenMismatch
Indicates the service account and the API key belong to different projects.
createUserWithEmail:password:completion:
Code
Meaning
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed.
FIRAuthErrorCodeEmailAlreadyInUse
Indicates the email used to attempt sign up already exists. CallfetchProvidersForEmail to check which sign-in mechanisms such user used, and prompt the user to sign in with one of those.
FIRAuthErrorCodeOperationNotAllowed
Indicates that email and password accounts are not enabled. Enable them in theAuthentication section of theFirebase console.
FIRAuthErrorCodeWeakPassword
Indicates an attempt to set a password that is considered too weak. TheNSLocalizedFailureReasonErrorKey field in theNSError.userInfo dictionary object will contain more detailed explanation that can be shown to the user.
signOut:
Code
Meaning
FIRAuthErrorCodeKeychainError
Indicated an error occurred when accessing the keychain. TheNSLocalizedFailureReasonErrorKey andNSUnderlyingErrorKey fields in theNSError.userInfo dictionary will contain more information about the error encountered.
FIRUser
Common errors for FIRUser operations
Code
Meaning
FIRAuthErrorCodeInvalidUserToken
Indicates that the signed-in user's refresh token, that holds session information, is invalid. You must prompt the user to sign in again on this device.
FIRAuthErrorCodeUserDisabled
Indicates the user's account is disabled and can no longer be used until enabled again from within the Users panel in theFirebase console.
reauthenticateWithCredential:completion:
Code
Meaning
FIRAuthErrorCodeInvalidCredential
Indicates the supplied credential is invalid. This could happen if it has expired or it is malformed.
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed, if credential is of the typeEmailPasswordAuthCredential.
FIRAuthErrorCodeWrongPassword
Indicates the user attempted reauthentication with an incorrect password, if credential is of the typeEmailPasswordAuthCredential.
FIRAuthErrorCodeUserMismatch
Indicates that an attempt was made to reauthenticate with a user which is not the current user.
FIRAuthErrorCodeOperationNotAllowed
Indicates that accounts with the identity provider represented by the credential are not enabled. Enable them in the Auth section of theFirebase console.
FIRAuthErrorCodeEmailAlreadyInUse
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 reauthenticated with this sign-in method. CallfetchProvidersForEmail for this user’s email and then prompt them to sign in with any of the sign-in providers returned. This error will only be thrown if the "One account per email address" setting is enabled in theFirebase console, underAuthentication settings.
FIRAuthErrorCodeUserDisabled
Indicates the user's account is disabled.
updateEmail:completion:
Code
Meaning
FIRAuthErrorCodeEmailAlreadyInUse
Indicates the email is already in use by another account.
FIRAuthErrorCodeInvalidEmail
Indicates the email address is malformed.
FIRAuthErrorCodeRequiresRecentLogin
Updating a user’s email 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 invokingreauthenticateWithCredential:completion: onFIRUser.
updatePassword:completion:
Code
Meaning
FIRAuthErrorCodeOperationNotAllowed
Indicates the administrator disabled sign in with the specified identity provider.
FIRAuthErrorCodeRequiresRecentLogin
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 invokingreauthenticateWithCredential:completion: onFIRUser.
FIRAuthErrorCodeWeakPassword
Indicates an attempt to set a password that is considered too weak. TheNSLocalizedFailureReasonErrorKey field in theNSError.userInfo dictionary object will contain more detailed explanation that can be shown to the user.
linkWithCredential:completion:
Code
Meaning
FIRAuthErrorCodeProviderAlreadyLinked
Indicates an attempt to link a provider of a type already linked to this account.
FIRAuthErrorCodeCredentialAlreadyInUse
Indicates an attempt to link with a credential that has already been linked with a different Firebase account.
FIRAuthErrorCodeOperationNotAllowed
Indicates that accounts with the identity provider represented by the credential are not enabled. Enable them in the Auth section of theFirebase console.
Indicates an attempt to unlink a provider that is not linked to the account.
FIRAuthErrorCodeRequiresRecentLogin
Updating email 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 invokingreauthenticateWithCredential:completion: onFIRUser.
sendEmailVerificationWithCompletion:
Code
Meaning
FIRAuthErrorCodeUserNotFound
Indicates the user account was not found.
deleteWithCompletion:
Code
Meaning
FIRAuthErrorCodeRequiresRecentLogin
Deleting a user account 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 invokingreauthenticateWithCredential:completion: onFIRUser.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-03 UTC."],[],[]]