firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Firebase MFA: isAppVerificationDisabledForTesting is not working
Step 0: Are you in the right place?
Having issue with isAppVerificationDisabledForTesting
flag.
[REQUIRED] Step 1: Describe your environment
- Xcode version:
13.3
- Firebase SDK version:
8.13.0
- Installation method:
Swift Package Manager
- Firebase Component:
Auth
- Target platform(s):
iOS
[REQUIRED] Step 2: Describe the problem
I'm trying to write UI/Integration testing to login with with Firebase MFA where first step is login with email/password and second as phone number / OTP. When I set a flag Auth.auth().settings?.isAppVerificationDisabledForTesting = true
after verifyPhoneNumber
it throws me an error below.
Error Domain=FIRAuthErrorDomain Code=17042 "Invalid format."
UserInfo={NSLocalizedDescription=Invalid format.,
FIRAuthErrorUserInfoNameKey=ERROR_INVALID_PHONE_NUMBER}
I use fictional phone number +16505554567 / 123356
and added it to the test phone numbers section in Firebase console.
I also tried to use real phone number. (didn't help)
Steps to reproduce:
- Enable
MFA
inIdentity Platform
. - Enable email/password provider.
- Enable phone number / OTP provider.
- Add fictional phone number under test phone numbers -
+16505554567 / 123356
- Then create user with email/password.
- Verify email
- Enrol 2 step authentication as phone number / OTP -
+16505554567
- Then (on another device or simulator) enable
Auth.auth().settings?.isAppVerificationDisabledForTesting = true
- Login with email/password
- Then try to complete required second step with
+16505554567
Expected behaviour It should proceed and ask for OTP code. Actual behaviour It throws error:
Error Domain=FIRAuthErrorDomain Code=17042 "Invalid format."
UserInfo={NSLocalizedDescription=Invalid format.,
FIRAuthErrorUserInfoNameKey=ERROR_INVALID_PHONE_NUMBER}
Without flag Auth.auth().settings?.isAppVerificationDisabledForTesting = true
it works as expected. Though it is not possible to write UI Testing due to reCaptcha.
Thanks for reporting, @romansorochak. Is the issue only reproducible on UI/integration testing? I'm unable to get the same error using the Auth Quickstart (though I haven't tried on UI testing).
@rizafran Thanks. This issue appears when login with 2FA. It doesn't matter wether I try to perform steps below manually or with UI/Integration testing.
- step is to login with email/password.
- then as a 2 step trying to verify phone number
Auth.auth().settings?.isAppVerificationDisabledForTesting = true
PhoneAuthProvider.provider().verifyPhoneNumber(
with: hint,
uiDelegate: nil,
multiFactorSession: multiFactorSession,
completion: completion
)
in completion
I receive error as below
Error Domain=FIRAuthErrorDomain Code=17042 "Invalid format."
UserInfo={NSLocalizedDescription=Invalid format.,
FIRAuthErrorUserInfoNameKey=ERROR_INVALID_PHONE_NUMBER}
Hi, thanks for filing this issue! We are unable to promise any timeline for this, but if others also have this issue, adding a +1 on this issue can help us prioritize adding this to the roadmap.
(Googler-only internal tracking bug: b/228617084)
@lisajian, @rizafran +1
+1
+1
+1
+1