-
Notifications
You must be signed in to change notification settings - Fork 990
Description
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
-
Generate a reCAPTCHA Enterprise Site Key in the Google Cloud Console.
Initialize Firebase App Check using this Enterprise site key with ReCaptchaEnterpriseProvider. -
Separately, generate a reCAPTCHA v3 site key at https://www.google.com/recaptcha.
-
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.)