firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.61k stars 3.95k forks source link

Domain=FIRAuthErrorDomain Code=17999 with firebase auth #13166

Closed vtd182 closed 2 weeks ago

vtd182 commented 1 month ago

Is there an existing issue for this?

Which plugins are affected?

Auth

Which platforms are affected?

Android, iOS

Description

I'm encountering this error when trying to log in using Firebase Auth on Flutter.

Initially, I added Firebase manually for Android using the JSON configuration, and the app worked perfectly fine. Then, I used FlutterFire to add Firebase for both Android and iOS. In one method, I performed a post to storage using Dio with the following headers:

{ 'content-type': 'application/json; charset=UTF-8', 'authorization': f'jwt', 'x-goog-upload-protocol': 'resumable', 'accept': '/', 'x-goog-upload-command': 'start', 'x-goog-upload-content-length': f'{imagesize}', 'accept-language': 'vi-VN,vi;q=0.9', 'x-firebase-storage-version': 'ios/10.13.0', 'user-agent': 'com.locket.Locket/1.43.1 iPhone/17.3 hw/iPhone15_3 (GTMSUF/1)', 'x-goog-upload-content-type': 'image/webp', 'x-firebase-gmpid': '1:641029076083:ios:cc8eb46290d69b234fa606' } After executing this method, all subsequent login attempts resulted in the following error:

flutter: [firebase_auth/internal-error] Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x600000c56880 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={NSUnderlyingError=0x600000c66a60 {Error Domain=com.google.HTTPStatus Code=403 "(null)" UserInfo={data={length = 688, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, data_content_type=application/json; charset=UTF-8}}, FIRAuthErrorUserInfoDeserializedResponseKey={ code = 403; details = ( { "@type" = "type.googleapis.com/google.rpc.ErrorInfo"; domain = "googleapis.com"; metadata = { consumer = "projects/641029076083"; service =<…>

Reproducing the issue

post an request with header: { 'content-type': 'application/json; charset=UTF-8', 'authorization': f'jwt', 'x-goog-upload-protocol': 'resumable', 'accept': '/', 'x-goog-upload-command': 'start', 'x-goog-upload-content-length': f'{imagesize}', 'accept-language': 'vi-VN,vi;q=0.9', 'x-firebase-storage-version': 'ios/10.13.0', 'user-agent': 'com.locket.Locket/1.43.1 iPhone/17.3 hw/iPhone15_3 (GTMSUF/1)', 'x-goog-upload-content-type': 'image/webp', 'x-firebase-gmpid': '1:641029076083:ios:cc8eb46290d69b234fa606' } then authenticate will be error

Firebase Core version

^3.3.0

Flutter Version

3.22.2

Relevant Log Output

flutter: [firebase_auth/internal-error] Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={FIRAuthErrorUserInfoNameKey=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x600000c2f120 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={NSUnderlyingError=0x600000c1efa0 {Error Domain=com.google.HTTPStatus Code=403 "(null)" UserInfo={data={length = 688, bytes = 0x7b0a2020 22657272 6f72223a 207b0a20 ... 5d0a2020 7d0a7d0a }, data_content_type=application/json; charset=UTF-8}}, FIRAuthErrorUserInfoDeserializedResponseKey={
    code = 403;
    details =     (
                {
            "@type" = "type.googleapis.com/google.rpc.ErrorInfo";
            domain = "googleapis.com";
            metadata =             {
                consumer = "projects/641029076083";
                service =<…>

Flutter dependencies

flutter_lints: 4.0.0 image_picker: ^1.1.2 video_player: ^2.9.1 permission_handler: 11.3.1 dio: ^5.5.0+1 flutter_bloc: ^8.1.5 equatable: ^2.0.5 rxdart: ^0.27.3 firebase_core: ^3.3.0 firebase_auth: ^5.1.4 firebase_storage: ^12.1.3 firebase_app_check: ^0.3.0+4

Additional context and comments

Additionally, I'm encountering an issue when uploading to Firebase Storage. After using FlutterFire, I couldn't upload files and received the error [firebase_storage/object-not-found] No object exists at the desired reference. Even though my bucket and reference were correct, the issue persisted.

My bucket was originally: my-bucket.appspot.com.

When I changed the bucket to just: my-bucket, I was able to retrieve data from the previous reference that was reported as non-existent. However, when I tried to upload, I encountered an "unauthorized" error. This led me to use Dio, which caused the error I previously mentioned. I cannot replicate the issue now because I am currently unable to log in. my firebase_storage: firebase_storage: ^12.1.3

Lyokone commented 1 month ago

Hello @vtd182, why are you not using firebase_storage to push to Storage directly?

google-oss-bot commented 3 weeks ago

Hey @vtd182. 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 commented 2 weeks ago

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

@vtd182 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.