Skip to content

Commit 042cca6

Browse files
Googlera-maurice
authored andcommitted
Handles the MISSING_CLIENT_IDENTIFIER error thrown by the backend.
PiperOrigin-RevId: 257697440
1 parent 457f4db commit 042cca6

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

auth/src/android/common_android.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static const ErrorCodeMapping kFirebaseAuthCodes[] = {
9999
{"ERROR_INVALID_TENANT_ID", kAuthErrorInvalidTenantId},
100100
{"ERROR_INVALID_DYNAMIC_LINK_DOMAIN", kAuthErrorInvalidLinkDomain},
101101
{"ERROR_TENANT_ID_MISMATCH", kAuthErrorTenantIdMismatch},
102+
{"ERROR_MISSING_CLIENT_IDENTIFIER", kAuthErrorMissingClientIdentifier},
102103
{nullptr},
103104
};
104105
// NOTE: THIS IS WHERE IT GETS REALLY DODGY

auth/src/desktop/rpcs/error_codes.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static const BackendErrorToCode kBackendErrorsToErrorCodeMap[] = {
6565
{"QUOTA_EXCEEDED", kAuthErrorQuotaExceeded},
6666
{"SESSION_EXPIRED", kAuthErrorSessionExpired},
6767
{"INVALID_APP_CREDENTIAL", kAuthErrorAppNotAuthorized},
68+
{"MISSING_CLIENT_IDENTIFIER", kAuthErrorMissingClientIdentifier},
6869
};
6970

7071
static const struct ErrorCodeToDescription {
@@ -171,7 +172,8 @@ static const struct ErrorCodeToDescription {
171172
"The requested provider ID is invalid. You must enable this provider in "
172173
"the console."},
173174
{kAuthErrorFailure, "An internal error has occurred."},
174-
};
175+
{kAuthErrorMissingClientIdentifier,
176+
"This request is missing a reCAPTCHA token."}};
175177

176178
} // namespace
177179

auth/src/include/firebase/auth/types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ enum AuthError {
344344
/// Indicates that a request was made to the backend with an invalid tenant
345345
/// ID.
346346
kAuthErrorInvalidTenantId,
347+
348+
/// Indicates that a request was made to the backend without a valid client
349+
/// identifier.
350+
kAuthErrorMissingClientIdentifier,
347351
};
348352

349353
} // namespace auth

auth/src/ios/auth_ios.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ @implementation FIRCPPAuthListenerHandle
9797
{FIRAuthErrorCodeWebContextCancelled, kAuthErrorWebContextCancelled},
9898
{FIRAuthErrorCodeWrongPassword, kAuthErrorWrongPassword},
9999
{FIRAuthErrorCodeInvalidProviderID, kAuthErrorInvalidProviderId},
100+
// TODO(b/137141080): Handle New Thick Client Error
101+
// Uncomment once support for MISSING_CLIENT_IDENTIFIER is added to the iOS SDK.
102+
// {FIRAuthErrorCodeMissingClientIdentifier, kAuthErrorMissingClientIdentifier},
100103
};
101104

102105
template<typename T>

0 commit comments

Comments
 (0)