FIRAuthInternalErrors.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. /** @var FIRAuthPublicErrorCodeFlag
  20. @brief Bitmask value indicating the error represents a public error code when this bit is
  21. zeroed. Error codes which don't contain this flag will be wrapped in an @c NSError whose
  22. code is @c FIRAuthErrorCodeInternalError.
  23. */
  24. static const NSInteger FIRAuthPublicErrorCodeFlag = 1 << 20;
  25. /** @var FIRAuthInternalErrorDomain
  26. @brief The Firebase Auth error domain for internal errors.
  27. */
  28. extern NSString *const FIRAuthInternalErrorDomain;
  29. /** @var FIRAuthErrorUserInfoDeserializedResponseKey
  30. @brief Errors with the code @c FIRAuthErrorCodeUnexpectedResponseError,
  31. @c FIRAuthErrorCodeUnexpectedErrorResponseError, and
  32. @c FIRAuthInternalErrorCodeRPCResponseDecodingError may contain an @c NSError.userInfo
  33. dictionary which contains this key. The value associated with this key is an object of
  34. unspecified contents containing the deserialized server response.
  35. */
  36. extern NSString *const FIRAuthErrorUserInfoDeserializedResponseKey;
  37. /** @var FIRAuthErrorUserInfoDataKey
  38. @brief Errors with the code @c FIRAuthErrorCodeUnexpectedResponseError or
  39. @c FIRAuthErrorCodeUnexpectedErrorResponseError may contain an @c NSError.userInfo
  40. dictionary which contains this key. The value associated with this key is an @c NSString
  41. which represents the response from a server to an RPC which could not be deserialized.
  42. */
  43. extern NSString *const FIRAuthErrorUserInfoDataKey;
  44. /** @var FIRAuthInternalErrorCode
  45. @brief Error codes used internally by Firebase Auth.
  46. @remarks All errors are generated using an internal error code. These errors are automatically
  47. converted to the appropriate public version of the @c NSError by the methods in
  48. @c FIRAuthErrorUtils
  49. */
  50. typedef NS_ENUM(NSInteger, FIRAuthInternalErrorCode) {
  51. /** @var FIRAuthInternalErrorCodeNetworkError
  52. @brief Indicates a network error occurred (such as a timeout, interrupted connection, or
  53. unreachable host.)
  54. @remarks These types of errors are often recoverable with a retry.
  55. See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details about
  56. the network error which occurred.
  57. */
  58. FIRAuthInternalErrorCodeNetworkError = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeNetworkError,
  59. /** @var FIRAuthInternalErrorCodeEmailAlreadyInUse
  60. @brief The email used to attempt a sign-up already exists.
  61. */
  62. FIRAuthInternalErrorCodeEmailAlreadyInUse = FIRAuthPublicErrorCodeFlag |
  63. FIRAuthErrorCodeEmailAlreadyInUse,
  64. /** @var FIRAuthInternalErrorCodeUserDisabled
  65. @brief Indicates the user's account is disabled on the server side.
  66. */
  67. FIRAuthInternalErrorCodeUserDisabled = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserDisabled,
  68. /** @var FIRAuthInternalErrorCodeWrongPassword
  69. @brief Indicates the user attempted sign in with a wrong password
  70. */
  71. FIRAuthInternalErrorCodeWrongPassword = FIRAuthPublicErrorCodeFlag |
  72. FIRAuthErrorCodeWrongPassword,
  73. /** @var FIRAuthInternalErrorCodeKeychainError
  74. @brief Indicates an error occurred accessing the keychain.
  75. @remarks The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary
  76. will contain more information about the error encountered.
  77. */
  78. FIRAuthInternalErrorCodeKeychainError = FIRAuthPublicErrorCodeFlag |
  79. FIRAuthErrorCodeKeychainError,
  80. /** @var FIRAuthInternalErrorCodeMissingClientType
  81. @brief Indicates an error for when the client type is missing.
  82. */
  83. FIRAuthInternalErrorCodeMissingClientType = FIRAuthPublicErrorCodeFlag |
  84. FIRAuthErrorCodeMissingClientType,
  85. /** @var FIRAuthInternalErrorCodeInternalError
  86. @brief An internal error occurred.
  87. @remarks This value is here for consistency. It's also used to make the implementation of
  88. wrapping internal errors simpler.
  89. */
  90. FIRAuthInternalErrorCodeInternalError = FIRAuthPublicErrorCodeFlag |
  91. FIRAuthErrorCodeInternalError,
  92. /** @var FIRAuthInternalErrorCodeTooManyRequests
  93. @brief Indicates that too many requests were made to a server method.
  94. */
  95. FIRAuthInternalErrorCodeTooManyRequests = FIRAuthPublicErrorCodeFlag |
  96. FIRAuthErrorCodeTooManyRequests,
  97. /** @var FIRAuthInternalErrorCodeInvalidCustomToken
  98. @brief Indicates a validation error with the custom token.
  99. */
  100. FIRAuthInternalErrorCodeInvalidCustomToken = FIRAuthPublicErrorCodeFlag |
  101. FIRAuthErrorCodeInvalidCustomToken,
  102. /** @var FIRAuthInternalErrorCodeCredentialMismatch
  103. @brief Indicates the service account and the API key belong to different projects.
  104. */
  105. FIRAuthInternalErrorCodeCustomTokenMismatch = FIRAuthPublicErrorCodeFlag |
  106. FIRAuthErrorCodeCustomTokenMismatch,
  107. /** @var FIRAuthInternalErrorCodeInvalidCredential
  108. @brief Indicates the IDP token or requestUri is invalid.
  109. */
  110. FIRAuthInternalErrorCodeInvalidCredential = FIRAuthPublicErrorCodeFlag |
  111. FIRAuthErrorCodeInvalidCredential,
  112. /** @var FIRAuthInternalErrorCodeRequiresRecentLogin
  113. @brief Indicates the user has attemped to change email or password more than 5 minutes after
  114. signing in.
  115. */
  116. FIRAuthInternalErrorCodeRequiresRecentLogin = FIRAuthPublicErrorCodeFlag |
  117. FIRAuthErrorCodeRequiresRecentLogin,
  118. /** @var FIRAuthInternalErrorCodeInvalidUserToken
  119. @brief Indicates user's saved auth credential is invalid, the user needs to sign in again.
  120. */
  121. FIRAuthInternalErrorCodeInvalidUserToken = FIRAuthPublicErrorCodeFlag |
  122. FIRAuthErrorCodeInvalidUserToken,
  123. /** @var FIRAuthInternalErrorCodeInvalidEmail
  124. @brief Indicates the email identifier is invalid.
  125. */
  126. FIRAuthInternalErrorCodeInvalidEmail = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeInvalidEmail,
  127. /** @var FIRAuthInternalErrorCodeAccountExistsWithDifferentCredential
  128. @brief Indicates account linking is needed.
  129. */
  130. FIRAuthInternalErrorCodeAccountExistsWithDifferentCredential =
  131. FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeAccountExistsWithDifferentCredential,
  132. /** @var FIRAuthInternalErrorCodeProviderAlreadyLinked
  133. @brief Indicates an attempt to link a provider to which we are already linked.
  134. */
  135. FIRAuthInternalErrorCodeProviderAlreadyLinked = FIRAuthPublicErrorCodeFlag |
  136. FIRAuthErrorCodeProviderAlreadyLinked,
  137. /** @var FIRAuthInternalErrorCodeNoSuchProvider
  138. @brief Indicates an attempt to unlink a provider that is not is not linked.
  139. */
  140. FIRAuthInternalErrorCodeNoSuchProvider = FIRAuthPublicErrorCodeFlag |
  141. FIRAuthErrorCodeNoSuchProvider,
  142. /** @var FIRAuthInternalErrorCodeUserTokenExpired
  143. @brief Indicates the token issue time is older than account's valid_since time.
  144. */
  145. FIRAuthInternalErrorCodeUserTokenExpired = FIRAuthPublicErrorCodeFlag |
  146. FIRAuthErrorCodeUserTokenExpired,
  147. /** @var FIRAuthInternalErrorCodeUserNotFound
  148. @brief Indicates the user account was been found.
  149. */
  150. FIRAuthInternalErrorCodeUserNotFound = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserNotFound,
  151. /** @var FIRAuthInternalErrorCodeInvalidAPIKey
  152. @brief Indicates an invalid API Key was supplied in the request.
  153. */
  154. FIRAuthInternalErrorCodeInvalidAPIKey = FIRAuthPublicErrorCodeFlag |
  155. FIRAuthErrorCodeInvalidAPIKey,
  156. /** @var FIRAuthInternalErrorCodeOperationNotAllowed
  157. @brief Indicates that admin disabled sign-in with the specified IDP.
  158. */
  159. FIRAuthInternalErrorCodeOperationNotAllowed = FIRAuthPublicErrorCodeFlag |
  160. FIRAuthErrorCodeOperationNotAllowed,
  161. /** @var FIRAuthInternalErrorCodeUserMismatch
  162. @brief Indicates that user attempted to reauthenticate with a user other than the current
  163. user.
  164. */
  165. FIRAuthInternalErrorCodeUserMismatch = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserMismatch,
  166. /** @var FIRAuthInternalErrorCodeCredentialAlreadyInUse
  167. @brief Indicates an attempt to link with a credential that has already been linked with a
  168. different Firebase account.
  169. */
  170. FIRAuthInternalErrorCodeCredentialAlreadyInUse = FIRAuthPublicErrorCodeFlag |
  171. FIRAuthErrorCodeCredentialAlreadyInUse,
  172. /** @var FIRAuthInternalErrorCodeWeakPassword
  173. @brief Indicates an attempt to set a password that is considered too weak.
  174. */
  175. FIRAuthInternalErrorCodeWeakPassword = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeWeakPassword,
  176. /** @var FIRAuthInternalErrorCodeAppNotAuthorized
  177. @brief Indicates the App is not authorized to use Firebase Authentication with the
  178. provided API Key.
  179. */
  180. FIRAuthInternalErrorCodeAppNotAuthorized = FIRAuthPublicErrorCodeFlag |
  181. FIRAuthErrorCodeAppNotAuthorized,
  182. /** @var FIRAuthInternalErrorCodeExpiredActionCode
  183. @brief Indicates the OOB code is expired.
  184. */
  185. FIRAuthInternalErrorCodeExpiredActionCode = FIRAuthPublicErrorCodeFlag |
  186. FIRAuthErrorCodeExpiredActionCode,
  187. /** @var FIRAuthInternalErrorCodeInvalidActionCode
  188. @brief Indicates the OOB code is invalid.
  189. */
  190. FIRAuthInternalErrorCodeInvalidActionCode = FIRAuthPublicErrorCodeFlag |
  191. FIRAuthErrorCodeInvalidActionCode,
  192. /** Indicates that there are invalid parameters in the payload during a "send password reset email
  193. * " attempt.
  194. */
  195. FIRAuthInternalErrorCodeInvalidMessagePayload = FIRAuthPublicErrorCodeFlag |
  196. FIRAuthErrorCodeInvalidMessagePayload,
  197. /** Indicates that the sender email is invalid during a "send password reset email" attempt.
  198. */
  199. FIRAuthInternalErrorCodeInvalidSender = FIRAuthPublicErrorCodeFlag |
  200. FIRAuthErrorCodeInvalidSender,
  201. /** Indicates that the recipient email is invalid.
  202. */
  203. FIRAuthInternalErrorCodeInvalidRecipientEmail = FIRAuthPublicErrorCodeFlag |
  204. FIRAuthErrorCodeInvalidRecipientEmail,
  205. /** Indicates that the iOS bundle ID is missing when a iOS App Store ID is provided.
  206. */
  207. FIRAuthinternalErrorCodeMissingIosBundleID = FIRAuthPublicErrorCodeFlag |
  208. FIRAuthErrorCodeMissingIosBundleID,
  209. /** Indicates that the android package name is missing when the @c androidInstallApp flag is set
  210. to true.
  211. */
  212. FIRAuthInternalErrorCodeMissingAndroidPackageName = FIRAuthPublicErrorCodeFlag |
  213. FIRAuthErrorCodeMissingAndroidPackageName,
  214. /** Indicates that the domain specified in the continue URL is not allowlisted in the Firebase
  215. console.
  216. */
  217. FIRAuthInternalErrorCodeUnauthorizedDomain = FIRAuthPublicErrorCodeFlag |
  218. FIRAuthErrorCodeUnauthorizedDomain,
  219. /** Indicates that the domain specified in the continue URI is not valid.
  220. */
  221. FIRAuthInternalErrorCodeInvalidContinueURI = FIRAuthPublicErrorCodeFlag |
  222. FIRAuthErrorCodeInvalidContinueURI,
  223. /** Indicates that a continue URI was not provided in a request to the backend which requires
  224. one.
  225. */
  226. FIRAuthInternalErrorCodeMissingContinueURI = FIRAuthPublicErrorCodeFlag |
  227. FIRAuthErrorCodeMissingContinueURI,
  228. /** Indicates that an email address was expected but one was not provided.
  229. */
  230. FIRAuthInternalErrorCodeMissingEmail = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeMissingEmail,
  231. /** Indicates that a phone number was not provided in a call to @c verifyPhoneNumber:completion:.
  232. */
  233. FIRAuthInternalErrorCodeMissingPhoneNumber = FIRAuthPublicErrorCodeFlag |
  234. FIRAuthErrorCodeMissingPhoneNumber,
  235. /** Indicates that an invalid phone number was provided in a call to @c
  236. verifyPhoneNumber:completion:.
  237. */
  238. FIRAuthInternalErrorCodeInvalidPhoneNumber = FIRAuthPublicErrorCodeFlag |
  239. FIRAuthErrorCodeInvalidPhoneNumber,
  240. /** Indicates that the phone auth credential was created with an empty verification code.
  241. */
  242. FIRAuthInternalErrorCodeMissingVerificationCode = FIRAuthPublicErrorCodeFlag |
  243. FIRAuthErrorCodeMissingVerificationCode,
  244. /** Indicates that an invalid verification code was used in the verifyPhoneNumber request.
  245. */
  246. FIRAuthInternalErrorCodeInvalidVerificationCode = FIRAuthPublicErrorCodeFlag |
  247. FIRAuthErrorCodeInvalidVerificationCode,
  248. /** Indicates that the phone auth credential was created with an empty verification ID.
  249. */
  250. FIRAuthInternalErrorCodeMissingVerificationID = FIRAuthPublicErrorCodeFlag |
  251. FIRAuthErrorCodeMissingVerificationID,
  252. /** Indicates that the APNS device token is missing in the verifyClient request.
  253. */
  254. FIRAuthInternalErrorCodeMissingAppCredential = FIRAuthPublicErrorCodeFlag |
  255. FIRAuthErrorCodeMissingAppCredential,
  256. /** Indicates that an invalid APNS device token was used in the verifyClient request.
  257. */
  258. FIRAuthInternalErrorCodeInvalidAppCredential = FIRAuthPublicErrorCodeFlag |
  259. FIRAuthErrorCodeInvalidAppCredential,
  260. /** Indicates that the reCAPTCHA token is not valid.
  261. */
  262. FIRAuthInternalErrorCodeCaptchaCheckFailed = FIRAuthPublicErrorCodeFlag |
  263. FIRAuthErrorCodeCaptchaCheckFailed,
  264. /** Indicates that an invalid verification ID was used in the verifyPhoneNumber request.
  265. */
  266. FIRAuthInternalErrorCodeInvalidVerificationID = FIRAuthPublicErrorCodeFlag |
  267. FIRAuthErrorCodeInvalidVerificationID,
  268. /** Indicates that the quota of SMS messages for a given project has been exceeded.
  269. */
  270. FIRAuthInternalErrorCodeQuotaExceeded = FIRAuthPublicErrorCodeFlag |
  271. FIRAuthErrorCodeQuotaExceeded,
  272. /** Indicates that an attempt was made to present a new web context while one was already being
  273. presented.
  274. */
  275. FIRAuthInternalErrorCodeWebContextAlreadyPresented = FIRAuthPublicErrorCodeFlag |
  276. FIRAuthErrorCodeWebContextAlreadyPresented,
  277. /** Indicates that the URL presentation was cancelled prematurely by the user.
  278. */
  279. FIRAuthInternalErrorCodeWebContextCancelled = FIRAuthPublicErrorCodeFlag |
  280. FIRAuthErrorCodeWebContextCancelled,
  281. /** Indicates a general failure during the app verification flow.
  282. */
  283. FIRAuthInternalErrorCodeAppVerificationUserInteractionFailure =
  284. FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeAppVerificationUserInteractionFailure,
  285. /** Indicates that the clientID used to invoke a web flow is invalid.
  286. */
  287. FIRAuthInternalErrorCodeInvalidClientID = FIRAuthPublicErrorCodeFlag |
  288. FIRAuthErrorCodeInvalidClientID,
  289. /** Indicates that a network request within a SFSafariViewController or WKWebView failed.
  290. */
  291. FIRAuthInternalErrorCodeWebNetworkRequestFailed = FIRAuthPublicErrorCodeFlag |
  292. FIRAuthErrorCodeWebNetworkRequestFailed,
  293. /** Indicates that an internal error occurred within a SFSafariViewController or WKWebView.
  294. */
  295. FIRAuthInternalErrorCodeWebInternalError = FIRAuthPublicErrorCodeFlag |
  296. FIRAuthErrorCodeWebInternalError,
  297. /** Indicates that an internal error occurred within a SFSafariViewController or WKWebView.
  298. */
  299. FIRAuthInternalErrorCodeWebSignInUserInteractionFailure =
  300. FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeWebSignInUserInteractionFailure,
  301. // The enum values between 17046 and 17051 are reserved and should NOT be used for new error
  302. // codes.
  303. /** Indicates that the SMS code has expired
  304. */
  305. FIRAuthInternalErrorCodeSessionExpired = FIRAuthPublicErrorCodeFlag |
  306. FIRAuthErrorCodeSessionExpired,
  307. FIRAuthInternalErrorCodeMissingAppToken = FIRAuthPublicErrorCodeFlag |
  308. FIRAuthErrorCodeMissingAppToken,
  309. FIRAuthInternalErrorCodeNotificationNotForwarded = FIRAuthPublicErrorCodeFlag |
  310. FIRAuthErrorCodeNotificationNotForwarded,
  311. FIRAuthInternalErrorCodeAppNotVerified = FIRAuthPublicErrorCodeFlag |
  312. FIRAuthErrorCodeAppNotVerified,
  313. /** Indicates that the Game Center local player was not authenticated.
  314. */
  315. FIRAuthInternalErrorCodeLocalPlayerNotAuthenticated = FIRAuthPublicErrorCodeFlag |
  316. FIRAuthErrorCodeLocalPlayerNotAuthenticated,
  317. /** Indicates that the Game Center local player was not authenticated.
  318. */
  319. FIRAuthInternalErrorCodeGameKitNotLinked = FIRAuthPublicErrorCodeFlag |
  320. FIRAuthErrorCodeGameKitNotLinked,
  321. /** Indicates that the second factor is required for sign in.
  322. */
  323. FIRAuthInternalErrorCodeSecondFactorRequired = FIRAuthPublicErrorCodeFlag |
  324. FIRAuthErrorCodeSecondFactorRequired,
  325. /** Indicates that the multi factor session is missing.
  326. */
  327. FIRAuthInternalErrorCodeMissingMultiFactorSession = FIRAuthPublicErrorCodeFlag |
  328. FIRAuthErrorCodeMissingMultiFactorSession,
  329. /** Indicates that the multi factor info is missing.
  330. */
  331. FIRAuthInternalErrorCodeMissingMultiFactorInfo = FIRAuthPublicErrorCodeFlag |
  332. FIRAuthErrorCodeMissingMultiFactorInfo,
  333. /** Indicates that the multi factor session is invalid.
  334. */
  335. FIRAuthInternalErrorCodeInvalidMultiFactorSession = FIRAuthPublicErrorCodeFlag |
  336. FIRAuthErrorCodeInvalidMultiFactorSession,
  337. /** Indicates that the multi factor info is not found.
  338. */
  339. FIRAuthInternalErrorCodeMultiFactorInfoNotFound = FIRAuthPublicErrorCodeFlag |
  340. FIRAuthErrorCodeMultiFactorInfoNotFound,
  341. /** Indicates that the operation is admin only.
  342. */
  343. FIRAuthInternalErrorCodeAdminRestrictedOperation = FIRAuthPublicErrorCodeFlag |
  344. FIRAuthErrorCodeAdminRestrictedOperation,
  345. /** Indicates that the email is unverified.
  346. */
  347. FIRAuthInternalErrorCodeUnverifiedEmail = FIRAuthPublicErrorCodeFlag |
  348. FIRAuthErrorCodeUnverifiedEmail,
  349. /** Indicates that the second factor is already enrolled.
  350. */
  351. FIRAuthInternalErrorCodeSecondFactorAlreadyEnrolled = FIRAuthPublicErrorCodeFlag |
  352. FIRAuthErrorCodeSecondFactorAlreadyEnrolled,
  353. /** Indicates that the number of multi factors reached the limit.
  354. */
  355. FIRAuthInternalErrorCodeMaximumSecondFactorCountExceeded =
  356. FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeMaximumSecondFactorCountExceeded,
  357. /** Indicates that the first factor is not supportted.
  358. */
  359. FIRAuthInternalErrorCodeUnsupportedFirstFactor = FIRAuthPublicErrorCodeFlag |
  360. FIRAuthErrorCodeUnsupportedFirstFactor,
  361. /** Indicates that the email needs to be verified before changed.
  362. */
  363. FIRAuthInternalErrorCodeEmailChangeNeedsVerification =
  364. FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeEmailChangeNeedsVerification,
  365. /** Indicates that the request does not contain any client identifier.
  366. */
  367. FIRAuthInternalErrorCodeMissingClientIdentifier = FIRAuthPublicErrorCodeFlag |
  368. FIRAuthErrorCodeMissingClientIdentifier,
  369. /** Indicates that the nonce is missing or invalid.
  370. */
  371. FIRAuthInternalErrorCodeMissingOrInvalidNonce = FIRAuthPublicErrorCodeFlag |
  372. FIRAuthErrorCodeMissingOrInvalidNonce,
  373. /** Indicates that a non-null user was expected as an argmument to the operation but a null
  374. user was provided.
  375. */
  376. FIRAuthInternalErrorCodeNullUser = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeNullUser,
  377. /** Indicates that the provider id given for the web operation is invalid.
  378. */
  379. FIRAuthInternalErrorCodeInvalidProviderID = FIRAuthPublicErrorCodeFlag |
  380. FIRAuthErrorCodeInvalidProviderID,
  381. /** @var FIRAuthInternalErrorCodeTenantIDMismatch
  382. @brief Indicates an error occurred when an attempt is made to update the current user with a
  383. tenantId that differs from the current FirebaseAuth instance's tenantId.
  384. */
  385. FIRAuthInternalErrorCodeTenantIDMismatch = FIRAuthPublicErrorCodeFlag |
  386. FIRAuthErrorCodeTenantIDMismatch,
  387. /** @var FIRAuthInternalErrorCodeUnsupportedTenantOperation
  388. @brief Indicates an error occurred when operation is not supported in a multi-tenant context.
  389. */
  390. FIRAuthInternalErrorCodeUnsupportedTenantOperation = FIRAuthPublicErrorCodeFlag |
  391. FIRAuthErrorCodeUnsupportedTenantOperation,
  392. /** Indicates that the Firebase Dynamic Link domain used is either not configured or is
  393. unauthorized for the current project.
  394. */
  395. FIRAuthInternalErrorCodeInvalidDynamicLinkDomain = FIRAuthPublicErrorCodeFlag |
  396. FIRAuthErrorCodeInvalidDynamicLinkDomain,
  397. FIRAuthInternalErrorCodeMalformedJWT = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeMalformedJWT,
  398. /** Indicates that an authentication blocking cloud function returned an error.
  399. */
  400. FIRAuthInternalErrorBlockingCloudFunctionError = FIRAuthPublicErrorCodeFlag |
  401. FIRAuthErrorCodeBlockingCloudFunctionError,
  402. /** Indicates that the recaptcha score sent to backend is invalid.
  403. */
  404. FIRAuthInternalErrorCodeInvalidRecaptchaScore = FIRAuthPublicErrorCodeFlag |
  405. FIRAuthErrorCodeCaptchaCheckFailed,
  406. /** Indicates that the recaptcha integration is not enabled for this project.
  407. */
  408. FIRAuthInternalErrorCodeRecaptchaNotEnabled = FIRAuthPublicErrorCodeFlag |
  409. FIRAuthErrorCodeRecaptchaNotEnabled,
  410. /** Indicates that the recaptcha sdk is not linked to the app.
  411. */
  412. FIRAuthInternalErrorCodeRecaptchaSDKNotLinked = FIRAuthPublicErrorCodeFlag |
  413. FIRAuthErrorCodeRecaptchaSDKNotLinked,
  414. /** @var FIRAuthInternalErrorCodeRPCRequestEncodingError
  415. @brief Indicates an error encoding the RPC request.
  416. @remarks This is typically due to some sort of unexpected input value.
  417. See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details.
  418. */
  419. FIRAuthInternalErrorCodeRPCRequestEncodingError = 1,
  420. /** @var FIRAuthInternalErrorCodeJSONSerializationError
  421. @brief Indicates an error serializing an RPC request.
  422. @remarks This is typically due to some sort of unexpected input value.
  423. If an @c NSJSONSerialization.isValidJSONObject: check fails, the error will contain no
  424. @c NSUnderlyingError key in the @c NSError.userInfo dictionary. If an error was
  425. encountered calling @c NSJSONSerialization.dataWithJSONObject:options:error:, the
  426. resulting error will be associated with the @c NSUnderlyingError key in the
  427. @c NSError.userInfo dictionary.
  428. */
  429. FIRAuthInternalErrorCodeJSONSerializationError = 2,
  430. /** @var FIRAuthInternalErrorCodeUnexpectedErrorResponse
  431. @brief Indicates an HTTP error occurred and the data returned either couldn't be deserialized
  432. or couldn't be decoded.
  433. @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details
  434. about the HTTP error which occurred.
  435. If the response could be deserialized as JSON then the @c NSError.userInfo dictionary will
  436. contain a value for the key @c FIRAuthErrorUserInfoDeserializedResponseKey which is the
  437. deserialized response value.
  438. If the response could not be deserialized as JSON then the @c NSError.userInfo dictionary
  439. will contain values for the @c NSUnderlyingErrorKey and @c FIRAuthErrorUserInfoDataKey
  440. keys.
  441. */
  442. FIRAuthInternalErrorCodeUnexpectedErrorResponse = 3,
  443. /** @var FIRAuthInternalErrorCodeUnexpectedResponse
  444. @brief Indicates the HTTP response indicated the request was a successes, but the response
  445. contains something other than a JSON-encoded dictionary, or the data type of the response
  446. indicated it is different from the type of response we expected.
  447. @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary.
  448. If this key is present in the dictionary, it may contain an error from
  449. @c NSJSONSerialization error (indicating the response received was of the wrong data
  450. type).
  451. See the @c FIRAuthErrorUserInfoDeserializedResponseKey value in the @c NSError.userInfo
  452. dictionary. If the response could be deserialized, it's deserialized representation will
  453. be associated with this key. If the @c NSUnderlyingError value in the @c NSError.userInfo
  454. dictionary is @c nil, this indicates the JSON didn't represent a dictionary.
  455. */
  456. FIRAuthInternalErrorCodeUnexpectedResponse = 4,
  457. /** @var FIRAuthInternalErrorCodeRPCResponseDecodingError
  458. @brief Indicates an error decoding the RPC response.
  459. This is typically due to some sort of unexpected response value from the server.
  460. @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details.
  461. See the @c FIRErrorUserInfoDecodedResponseKey value in the @c NSError.userInfo dictionary.
  462. The deserialized representation of the response will be associated with this key.
  463. */
  464. FIRAuthInternalErrorCodeRPCResponseDecodingError = 5,
  465. };
  466. NS_ASSUME_NONNULL_END