Skip to content

Invalid site key or not loaded in api.js when firebase initializeAppCheck with ReCaptchaEnterpriseProvider #9405

@kayp514

Description

@kayp514

Operating System

Windows 11

Environment (if applicable)

Chrome

Firebase SDK Version

12.0.0

Firebase SDK Product(s)

AppCheck, Auth

Project Tooling

Next.js app

Detailed Problem Description

When AppCheck enforcement is enabled for Authentication, SMS-based sign-in stops working. This happens specifically when Firebase initializes App Check using the ReCaptchaEnterpriseProvider.

However, if App Check is initialized with ReCaptchaV3Provider, SMS-based authentication works correctly with any site key configured in Firebase Console → Authentication → Settings → reCAPTCHA (v3, v2 challenge, or Enterprise).

If App Check is initialized with ReCaptchaEnterpriseProvider, SMS-based auth only works when the reCAPTCHA Web keys in Firebase Console → Authentication → Settings → reCAPTCHA are set to None. In that case, the SMS code is received and verification succeeds.

This leads to the question: What is the correct configuration for using App Check with reCAPTCHA Enterprise and Phone Authentication?

Steps and code to reproduce issue

  1. Generate a reCAPTCHA Enterprise Site Key in the Google Cloud Console.
    Initialize Firebase App Check using this Enterprise site key with ReCaptchaEnterpriseProvider.

  2. Separately, generate a reCAPTCHA v3 site key at https://www.google.com/recaptcha.

  3. In the Firebase Console, go to:
    Authentication → Settings → reCAPTCHA
    For Web, configure the phone authentication protection using either: reCAPTCHA v3, reCAPTCHA v2 (challenge) or reCAPTCHA Enterprise (Both keys fail when App Check is initialized with the Enterprise provider.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions