我需要的是所有不同的登录错误的FirebaseAuthentication代码的完整列表,也是所有这些错误的列表。到目前为止,我已经通过反复试验找到了一些,但我不能冒险错过了一些。
我正在使用Firebase简单登录,使用电子邮件/密码,facebook,twitter和匿名登录。显然,有这么多的登录方法,用户可能会有很多方法无法正确登录(不正确的电子邮件格式,没有输入密码等)。目前,我正在使用以下代码:
... authenticateWithDictionary method
completion:^(NSError * error, id<PUser> user) {
if (!error) {
[self loginButtonPressed:Nil];
}
else {
[UIView alertWithTitle:bErrorTitle withError:error];
}
这样做的唯一问题是,我得到的错误如下所示:
**(Error Code: EMAIL_TAKEN) The specified email address is already in use.**
这可以让我知道在测试中出了什么问题,但一旦应用程序上线,我将希望单独的消息a)看起来更整洁b)让用户知道他们为什么会有这个错误
到目前为止,通过试验和错误,我得出了以下结论:
错误码
-5 INVALID EMAIL - empty or incorrect format
-6 INVALID PASSWORD
-9 EMAIL TAKEN
一旦我有了一个完整的列表,我将使用switch语句来正确地处理它们
有没有人知道错误代码和错误的综合列表,以便我可以将它们全部考虑在内,而不必考虑所有选项,这可能意味着我会遗漏一个选项
发布于 2014-12-11 18:14:15
以下是来自Firebase网站的错误代码的完整列表:
https://www.firebase.com/docs/web/guide/user-auth.html#section-full-error
发布于 2018-01-07 00:00:38
您可以在FirebaseAuth.framework
中的FIRAuthErrorCode
枚举下找到所有firebase身份验证错误代码和解释
/*
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,
发布于 2016-11-25 11:02:29
IOS身份验证错误包括:
名称:哈希;RawValue(代码):
- AccountExistsWithDifferentCredential: 10; 17012
- InvalidEmail: 6; 17008
- NetworkError: 15; 17020
- UserDisabled: 3; 17005
- UserMismatch: 18; 17024
- UserNotFound: 9; 17011
- WeakPassword: 20; 17026
- InternalError: 23; 17999
- InvalidAPIKey: 17; 17023
- KeychainError: 22; 17995
- WrongPassword: 7; 17009
- NoSuchProvider: 13; 17016
- TooManyRequests: 8; 17010
- AppNotAuthorized: 21; 17028
- InvalidUserToken: 14; 17017
- UserTokenExpired: 16; 17021
- EmailAlreadyInUse: 5; 17007
- InvalidCredential: 2; 17004
- InvalidCustomToken: 0; 17000
- CustomTokenMismatch: 1; 17002
- OperationNotAllowed: 4; 17006
- RequiresRecentLogin: 11; 17014
- ProviderAlreadyLinked: 12; 17015
- CredentialAlreadyInUse: 19; 17025
https://stackoverflow.com/questions/27420176
复制相似问题