sim*_*ley 4 objective-c ios firebase firebase-security
我需要的是针对所有不同登录错误的FirebaseAuthentication代码的完整列表,以及所有这些错误的列表。到目前为止,我已经通过反复试验找到了一些,但是不能冒险错过了一些。
我正在使用Firebase简单登录名通过电子邮件/密码,facebook,twitter以及匿名登录名进行登录。显然,使用这么多的登录方法,用户有很多方法无法正确登录(错误的电子邮件格式,未输入密码等)。目前,我正在使用此代码:
... authenticateWithDictionary method
completion:^(NSError * error, id<PUser> user) {
if (!error) {
[self loginButtonPressed:Nil];
}
else {
[UIView alertWithTitle:bErrorTitle withError:error];
}
Run Code Online (Sandbox Code Playgroud)
唯一的问题是我结束了这样的错误提示:
**(Error Code: EMAIL_TAKEN) The specified email address is already in use.**
Run Code Online (Sandbox Code Playgroud)
可以让我知道测试中出了什么问题,但是一旦该应用上线后,我将希望发送单个消息a)看起来更整洁b)让用户知道为什么会出现此错误
到目前为止,通过反复试验,我得出以下结论:
错误代码
-5 INVALID EMAIL - empty or incorrect format
-6 INVALID PASSWORD
-9 EMAIL TAKEN
Run Code Online (Sandbox Code Playgroud)
一旦有了完整的列表,我将使用switch语句正确处理所有问题
有谁知道错误代码和错误的完整列表,以便我可以将它们全部考虑在内,而不必仔细考虑所有可能意味着我错过的选项
您可以在以下FIRAuthErrorCode枚举下找到所有firebase身份验证错误代码和说明。FirebaseAuth.framework
/*
Indicates a validation error with the custom token.
*/
FIRAuthErrorCodeInvalidCustomToken = 17000,
/*
Indicates the service account and the API key belong to different projects.
*/
FIRAuthErrorCodeCustomTokenMismatch = 17002,
/*
Indicates the IDP token or requestUri is invalid.
*/
FIRAuthErrorCodeInvalidCredential = 17004,
/*
Indicates the user's account is disabled on the server.
*/
FIRAuthErrorCodeUserDisabled = 17005,
/*
Indicates the administrator disabled sign in with the specified identity provider.
*/
FIRAuthErrorCodeOperationNotAllowed = 17006,
/*
Indicates the email used to attempt a sign up is already in use.
*/
FIRAuthErrorCodeEmailAlreadyInUse = 17007,
/*
Indicates the email is invalid.
*/
FIRAuthErrorCodeInvalidEmail = 17008,
/*
Indicates the user attempted sign in with a wrong password.
*/
FIRAuthErrorCodeWrongPassword = 17009,
/*
Indicates that too many requests were made to a server method.
*/
FIRAuthErrorCodeTooManyRequests = 17010,
/*
Indicates the user account was not found.
*/
FIRAuthErrorCodeUserNotFound = 17011,
/*
Indicates account linking is required.
*/
FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012,
/*
Same enum as @c FIRAuthErrorCodeAccountExistsWithDifferentCredential ,
but with incorrect spelling. Only exists for backwards compatiblity.
*/
FIRAuthErrrorCodeAccountExistsWithDifferentCredential = 17012,
/*
Indicates the user has attemped to change email or password more than 5 minutes after
signing in.
*/
FIRAuthErrorCodeRequiresRecentLogin = 17014,
/*
Indicates an attempt to link a provider to which the account is already linked.
*/
FIRAuthErrorCodeProviderAlreadyLinked = 17015,
/*
Indicates an attempt to unlink a provider that is not linked.
*/
FIRAuthErrorCodeNoSuchProvider = 17016,
/*
Indicates user's saved auth credential is invalid, the user needs to sign in again.
*/
FIRAuthErrorCodeInvalidUserToken = 17017,
/*
Indicates a network error occurred (such as a timeout, interrupted connection, or
unreachable host). These types of errors are often recoverable with a retry. The @c
NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the error
encountered.
*/
FIRAuthErrorCodeNetworkError = 17020,
/*
Indicates the saved token has expired, for example, the user may have changed account
password on another device. The user needs to sign in again on the device that made this
request.
*/
FIRAuthErrorCodeUserTokenExpired = 17021,
/*
Indicates an invalid API key was supplied in the request.
*/
FIRAuthErrorCodeInvalidAPIKey = 17023,
/*
Indicates that an attempt was made to reauthenticate with a user which is not the current
user.
*/
FIRAuthErrorCodeUserMismatch = 17024,
/*
Indicates an attempt to link with a credential that has already been linked with a
different Firebase account
*/
FIRAuthErrorCodeCredentialAlreadyInUse = 17025,
/*
Indicates an attempt to set a password that is considered too weak.
*/
FIRAuthErrorCodeWeakPassword = 17026,
/*
Indicates the App is not authorized to use Firebase Authentication with the
provided API Key.
*/
FIRAuthErrorCodeAppNotAuthorized = 17028,
/*
Indicates the OOB code is expired.
*/
FIRAuthErrorCodeExpiredActionCode = 17029,
/*
Indicates the OOB code is invalid.
*/
FIRAuthErrorCodeInvalidActionCode = 17030,
/*
Indicates that there are invalid parameters in the payload during a "send password reset
* email" attempt.
*/
FIRAuthErrorCodeInvalidMessagePayload = 17031,
/*
Indicates that the sender email is invalid during a "send password reset email" attempt.
*/
FIRAuthErrorCodeInvalidSender = 17032,
/*
Indicates that the recipient email is invalid.
*/
FIRAuthErrorCodeInvalidRecipientEmail = 17033,
/*
Indicates an error occurred while attempting to access the keychain.
*/
FIRAuthErrorCodeKeychainError = 17995,
/*
Indicates an internal error occurred.
*/
FIRAuthErrorCodeInternalError = 17999,
Run Code Online (Sandbox Code Playgroud)
Ben*_*ley -1
以下是 Firebase 网站上的错误代码的完整列表:
https://www.firebase.com/docs/web/guide/user-auth.html#section-full-error
| 归档时间: |
|
| 查看次数: |
8145 次 |
| 最近记录: |