-
Notifications
You must be signed in to change notification settings - Fork 4k
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
🐛 [firebase_auth] [firebase_auth/invalid-credential] The supplied auth credential is malformed, has expired, or is not currently supported error after credential-already-in-use exception #11841
Comments
@nohe427 Could you please take a look at this? |
Hi @ashu2902, please provide a complete minimal reproducible code sample in a repo that we can clone so that we can investigate this issue. Thank you |
I can confirm this. I'm facing the same issue. |
Hi @MirceaX2Mobile, please provide a complete minimal reproducible code sample in a repo that we can clone so that we can investigate this issue. Thank you |
Hello @danagbemava-nc @ashu2902 @russellwheatley @darshankawar! So I made a reproducible code. But you will need a Firebase Project with PhoneNumber Auth enabled. I will attach the code bellow. There are 2 textfields one for the phoneNumber, one for the otpCode, each textfield has a button for sendingSMS and sendingOTP. After that you get credential-already-in-use error and then you use the credential from the error to log into the existing account. logInToExistingAccount will throw
pubspec.yaml firebase_core: ^2.13.1
firebase_in_app_messaging: ^0.7.3+2
firebase_messaging: ^14.6.2
firebase_analytics: ^10.4.2
firebase_database: ^10.2.2
firebase_auth: ^4.13.0
firebase_crashlytics: ^3.3.2
firebase_remote_config: ^4.2.2 |
Thanks @MirceaX2Mobile, for the repro. I can reproduce the issue. Triage report.These are the steps I used to reproduce the issue.
You will now get the exception There's another case of this in #11877, although it uses a different sign in method |
@danagbemava-nc No problem, glad to help you guys! |
Bug report
Describe the bug
this is the exact description of the problem:
After the anonymous sign-in, when I try to link the credentials of the anonymous account to PhoneAuth credentials.
If the PhoneAuth credential is an already existing account, it throws an exception "credential-already-in-use".
in the catch block, I delete the anonymous account and use the signInWithCredentials(), which I receive in the catch block. (since the error is thrown by 'linkWithCredential()', I receive the credentials along with the token).
At the third step it started throwing an error: [firebase_auth/invalid-credential] The supplied auth credential is malformed, has expired, or is not currently supported.
Also, this is happening only on my iOS devices and it is working perfectly on Android.
Steps to reproduce
Steps to reproduce the behavior:
1.Sign in the user with anonymous provider
2. Try to link the credentials with phone number of an account that already exists in the firebase authentication
3. in the catch block of linkWithCredentials, attempt signInWithCredentials and use the credentials provided in the error.credentials
4. it throws the error: [firebase_auth/invalid-credential] The supplied auth credential is malformed, has expired, or is not currently supported.
Expected behavior
The expected behavior is that the user would be logged in with the credentials received in the catch block.
Sample project
Additional context
Add any other context about the problem here.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: