Closed KunalxBhandari closed 2 weeks ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @KunalxBhandari, I wasn't able to reproduce this in v11. I tried Xcode 15 and Xcode 16 and used a device running iOS 17. When PhoneAuthProvider.provider().verifyPhoneNumber(...)
is called, what behavior do you see? Does anything happen (e.g. recaptcha window appear, etc.) before the callback is called with the error?
cc: @jordanebelanger
If the issue can be easily reproduced, it would be helpful to know where the error is being thrown as there are a few places within the phone provider logic where it could occur.
To debug, enable Swift error breakpoints, run the app, and perform the behavior that makes the error appear. Execution may pause on a few false positives, but what we are looking for are any breakpoints that pause execution in the PhoneAuthProvider.swift
file.
Knowing where those pauses occur would help narrow things down.
Possibly related:
Since Aug 8th, we've started seeing occasional INVALID_APP_CREDENTIAL
errors for the google.cloud.identitytoolkit.v2.AuthenticationService.StartMfaSignIn
method.
However, we're on Firebase iOS SDK version 10.24.0 since a while back. We have not made any recent changes on our side that could have caused this.
@ncooke3 we're having the same token mismatch as well. It's reproducible for us across multiple devices on 11.0. Everything was working great for us on 10.29 and earlier
I added a Swift Breakpoint Error and see that the verifyClient func in PhoneAuthProvider is failing. I get the following error message: Error Domain=FIRAuthErrorDomain Code=17048 "Token mismatch" UserInfo={NSLocalizedDescription=Token mismatch, FIRAuthErrorUserInfoNameKey=INVALID_APP_CREDENTIAL}
Not sure if this is relevant but the breakpoint was firing on the AuthBackendRPCImplementation callInternal func
Thanks, @deirinberg. Question, does the Recaptcha UI flow get presented at all during the process?
downgrading to 10.27 worked, thank you! not sure if 10.29 would work as well, I just chose 10.27.
otherwise, some relevant information:
I saw the recaptcha flow when I use the simulator, not when using the device. not sure if this is helpful, I tried to add a breakpoint, but I don't really know how to interpret the output. Here's where it went however:
I don't see the recaptcha UI flow on device, haven't tested on simulator
This has been fixed by #13539 and #13519. These fixes are staged to go out in the next Firebase release, 11.2.
thanks @ncooke3!
v11.2 released today and should resolve this issue. Thanks again for reporting!
Thanks @ncooke3!
Description
I'm using the latest firebase version 11.0.0 and on iOS 16 and above, I'm unable to login using PhoneAuthProvider. I'm getting the below error message:
Error Domain=FIRAuthErrorDomain Code=17048 "Token mismatch" UserInfo={FIRAuthErrorUserInfoNameKey=INVALID_APP_CREDENTIAL, NSLocalizedDescription=Token mismatch}
Although it's working fine on 10.29.0 version.
Reproducing the issue
PhoneAuthProvider.provider().verifyPhoneNumber("+911234567899", uiDelegate: nil) { [weak self] (verificationID , error) in if let error = error { print(error) let authErr = error as NSError let alert = UIAlertController(title: "Something went wrong. Please try again later", message: nil, preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) self?.present(alert, animated: true, completion: nil) } else { //Successful } }
Firebase SDK Version
11.0.0
Xcode Version
15.4
Installation Method
CocoaPods
Firebase Product(s)
Authentication
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippet```json Replace this line with the contents of your Package.resolved. ```
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippet```yml Replace this line with the contents of your Podfile.lock! ```