Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTH]: Flutter web "signInWithPhoneNumber" error : invalid-app-credential #13098

Closed
saharvx9 opened this issue Jul 25, 2024 · 9 comments
Closed
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. blocked: firebase-sdk closed-by-bot platform: web Issues / PRs which are specifically for web. plugin: auth Stale Issue with no recent activity type: bug Something isn't working

Comments

@saharvx9
Copy link

saharvx9 commented Jul 25, 2024

Which plugins are affected?

firebase_auth

Which platforms are affected?

Web

Description

When i am using test numbers and calling signInWithPhoneNumber working great, but when i am using real numbers, i am getting all the time error of : invalid-app-credential

I checked in the github of firebase js and saw this issue :
firebase/firebase-js-sdk#8387

Same as error i receive,
For veryfication, i working at the porject with firebase long time, so configuration are correct and using
on my main widget :

 await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

Snipt code :

  void submitPhoneNumber() async {
    state.add(Loading());
    if (!_validPhone(_phoneNumber)) {
      state.add(Error("Not valid"));
      return;
    }

    final phone = "+972${_phoneNumber!.substring(1, _phoneNumber!.length)}";

    try {
      _confirmationResult = await _auth.signInWithPhoneNumber(phone);
      logI("verificationSent ${_confirmationResult?.verificationId}");
      state.add(DisplayPinCode());
    } on FirebaseAuthException catch (e){
      logE("verificationFailed : ${e.message}, code ${e.code}", stackTrace: e.stackTrace);
    } catch (e, s) {
      logE("verificationFailed : $e", stackTrace: s);
    }
  }

Flutter doctor :

[!] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-IL)
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.0.5/libexec/bin/dart, which is not inside your current Flutter SDK
      checkout at /Users/saharvanunu/flutter. Consider adding /Users/saharvanunu/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] IntelliJ IDEA Community Edition (version 2024.1.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (3 available)
    ! Error: Browsing on the local area network for גילה iphone. Ensure the device is unlocked and attached with a cable or associated with the
      same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

Reproducing the issue

  1. Call signInWithPhoneNumber
  2. receive immediately error

Expect :
Get sms with no errors.

Firebase Core version

3.2.0

Flutter Version

3.22.2

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
  firebase_core: 3.2.0
  firebase_auth: 5.1.2
  cloud_firestore: 5.1.0
  firebase_storage: 12.1.1
  cloud_functions: 5.0.3

Additional context and comments

No response

@saharvx9 saharvx9 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jul 25, 2024
@Lyokone
Copy link
Contributor

Lyokone commented Jul 25, 2024

Thanks for linking the JS issue, it seems to be related to the native SDK, so it will need to be resolved by the backend teams.

@Lyokone Lyokone added blocked: firebase-sdk plugin: auth platform: web Issues / PRs which are specifically for web. and removed Needs Attention This issue needs maintainer attention. labels Jul 25, 2024
@lisovyk
Copy link

lisovyk commented Jul 25, 2024

Same is happening for us in production at web! Any quick ways to fix it from out side?

@Lyokone
Copy link
Contributor

Lyokone commented Jul 26, 2024

@lisovyk Not yet, you can follow firebase/firebase-js-sdk#8387 for more information

@lisovyk
Copy link

lisovyk commented Jul 26, 2024

@Lyokone we tracked it down to one of the carriers in Ukraine not getting OTP's while others work fine, and firebase giving us the same error. If only there was a dashboard with all carrier statuses updated at least daily, huh. It's an issue we encounter couple times a year, every time with new surprising and exciting error messages not telling you a thing.

@Lyokone
Copy link
Contributor

Lyokone commented Jul 29, 2024

It seems related to this comment: #13100

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Jul 29, 2024
@PROGrand
Copy link

PROGrand commented Aug 1, 2024

Error appears when web app run on localhost (from IDE).
And not appears when run on deployment server with ssl.

@google-oss-bot google-oss-bot added the Stale Issue with no recent activity label Aug 12, 2024
@google-oss-bot
Copy link

Hey @saharvx9. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@saharvx9 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@SheharyarAmin
Copy link

Any updates on this?

@firebase firebase locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. blocked: firebase-sdk closed-by-bot platform: web Issues / PRs which are specifically for web. plugin: auth Stale Issue with no recent activity type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants