Skip to content

iOS phone auth calls legacy v3/relyingparty endpoint — reCAPTCHA Enterprise tokens rejected (503) on @react-native-firebase/auth v24.1.1 / Firebase iOS SDK 12.10.0 #9061

Description

@drabdanoo

Environment

Version
@react-native-firebase/app 24.1.1 (latest on npm)
@react-native-firebase/auth 24.1.1
Firebase iOS SDK (bundled) 12.10.0 (from package.json sdkVersions.ios.firebase)
Expo SDK 56.0.0
React Native 0.85.3
Platform iOS only (Android phone auth works)
Distribution TestFlight / production APNs
iOS version tested iOS 26.5 (iPhone 17,3)
Firebase project tabiby-rn, project number 58556901822
App bundle ID com.khazer.tabiby

What is happening

Phone auth (signInWithPhoneNumber) fails on real iOS devices (TestFlight). Firebase test numbers pass fine. The SDK surfaces [auth/internal-error] An internal error has occurred which is an empty-body 400/503 — the real server error is hidden.

Android phone auth works correctly — SMS delivers, OTP flow completes.


Root cause — confirmed from Sentry network breadcrumbs (production build)

The SDK calls the legacy googleapis.com/identitytoolkit/v3/relyingparty endpoint rather than the modern identitytoolkit.googleapis.com/v1/accounts endpoint. reCAPTCHA Enterprise tokens are generated successfully (all api3 calls return 200) but are then sent to the v3 endpoint which rejects them.

Full network trace from Sentry breadcrumbs on build com.khazer.tabiby@1.0.1+20:

POST [Filtered]  403  ← APNs verifyClient rejected
POST [Filtered]  400  ← sendVerificationCode first attempt rejected
GET  https://identitytoolkit.googleapis.com/v2/recaptchaConfig  200  ← SDK fetches reCAPTCHA config
GET  https://www.gstatic.com/recaptcha/verify_key/orcas/prod/ios/verify_key.txt  200
POST https://www.recaptcha.net/recaptcha/api3/mri  200  ─┐
POST https://www.recaptcha.net/recaptcha/api3/moa  200   ├─ reCAPTCHA Enterprise token generated OK
POST https://www.recaptcha.net/recaptcha/api3/mrr  200  ─┘
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode  503  ← FAILS

The reCAPTCHA Enterprise token is generated (Firebase Console confirms healthy scores), but is sent to https://www.googleapis.com/identitytoolkit/v3/relyingparty/sendVerificationCode which returns 503 Service Unavailable.

The v3 endpoint predates reCAPTCHA Enterprise. The modern endpoint that accepts these tokens is https://identitytoolkit.googleapis.com/v1/accounts:sendVerificationCode.


Additional context

  • Both credential paths fail: APNs verifyClient returns 403. reCAPTCHA Enterprise token sent to v3 returns 503. This is not a configuration issue — every configurable surface has been verified correct over 19+ TestFlight builds.
  • Firebase iOS SDK 12.10.0 is what @react-native-firebase v24.1.1 bundles (from package.json sdkVersions.ios.firebase). Firebase iOS SDK 12.15.0 is the latest available; its changelog (12.11–12.15) shows no phone auth endpoint changes.
  • @react-native-firebase v24.1.1 is already the latest on npm — there is no v25 to upgrade to.
  • Android works — presumably because the Android Firebase SDK already uses the modern endpoint (or Play Integrity tokens are accepted by v3).
  • Probing v3/relyingparty/sendVerificationCode directly with the iOS API key returns INVALID_APP_CREDENTIAL without a reCAPTCHA token, and 503 with a reCAPTCHA Enterprise token.
  • The 503 may indicate Google is actively deprecating the v3 endpoint, which would mean every iOS app on @react-native-firebase v24 is affected or about to be affected.

What we need

  1. Confirmation of which Identity Toolkit endpoint Firebase iOS SDK 12.10.0 calls for phone auth.
  2. Confirmation of which Firebase iOS SDK version switches to v1/accounts:sendVerificationCode.
  3. A patch release of @react-native-firebase that bundles a Firebase iOS SDK version where the correct endpoint is used.

The workaround in place is Google Sign-In + Apple Sign-In (both work fine via OAuth/OIDC, bypassing phone auth entirely). But phone OTP is the primary sign-in method for this healthcare app's user base.


Steps to reproduce

  1. Install @react-native-firebase/auth v24.1.1 in an Expo SDK 56 app.
  2. Configure Firebase phone auth with reCAPTCHA Enterprise (PHONE_PROVIDER: ENFORCE).
  3. Distribute via TestFlight (production APNs environment).
  4. Call signInWithPhoneNumber(auth, phoneNumber) on a real iOS device.
  5. Observe: no SMS received. auth/internal-error thrown.
  6. Inspect Sentry/network logs: v3/relyingparty/sendVerificationCode called, returns 503.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions