firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Sign In With Apple revokeToken returns an error occurred in Auth Emulator

Open hulk510 opened this issue 1 year ago • 9 comments

Description

Hi, there.

I wrote revoking token flow that read this guide. and I have observed revokeToken is working successfully in the real Firebase Auth (production) environment. However, when I try to use revokeToken with the emulator environment, it does not succeed and error. I have shared the code here.

スクリーンショット 2023-06-22 13 39 39

Expected Behavior

I expect the revokeToken function to succeed when used in the emulator environment. It should function in a similar manner to the real Firebase Auth (production) environment. If this behavior is not a bug and there is a specific configuration or workaround required for the emulator, I would greatly appreciate any guidance or comments you can provide.

Thank you for your attention to this matter. Please let me know if you require any additional information or clarification.

Best regards,

Reproducing the issue

  1. Sign in with Apple using the Firebase Emulator environment.
  2. Run the following code: Auth.auth().revokeToken(withAuthorizationCode: code).

Firebase SDK Version

10.9.0

Xcode Version

14.3.1(14E300c)

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

2023-06-23 13:51:52.070776+0900 [2212:397967] 10.9.0 - [FirebaseAuth][I-AUT000017] Has valid access token. Estimated expiration date: 2023-06-23 05:51:39 +0000, current date: 2023-06-23 04:51:52 +0000
2023-06-23 13:51:52.071260+0900 [2212:397967] 10.9.0 - [FirebaseAuth][I-AUT000017] Actual token expiration date: 2023-06-23 05:51:39 +0000, current date: 2023-06-23 04:51:52 +0000
Printing description of error:
Error Domain=FIRAuthErrorDomain Code=17004 "An internal error has occurred, print and inspect the error details for more information." UserInfo={NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., FIRAuthErrorUserInfoNameKey=ERROR_INVALID_CREDENTIAL}
An internal error has occurred, print and inspect the error details for more information.
2023-06-23 13:52:47.453173+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R.] seq=2523658095, ack=653370711, win=2048 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.455383+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R] seq=2523658094, ack=0, win=0 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.455656+0900 [2212:398085] [tcp] tcp_input [C3:2] flags=[R] seq=2523658094, ack=0, win=0 state=TIME_WAIT rcv_nxt=2523658095, snd_una=653370711
2023-06-23 13:52:47.456832+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Backfill Indexes: 0 changes (0 bytes):>
2023-06-23 13:52:47.456935+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Garbage collection skipped; Cache size 21758 is lower than threshold 104857600
2023-06-23 13:52:47.457088+0900 [2212:398423] 10.9.0 - [FirebaseFirestore][I-FST000001] Committing transaction: <LevelDbTransaction Collect garbage: 0 changes (0 bytes):>

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

{
  "pins" : [
    {
      "identity" : "abseil-cpp-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/abseil-cpp-binary.git",
      "state" : {
        "revision" : "a5f16ba68913840ee5df91b8dc06f5cc063579de",
        "version" : "1.2021110200.0"
      }
    },
    {
      "identity" : "firebase-ios-sdk",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/firebase-ios-sdk.git",
      "state" : {
        "revision" : "4961c0b7eb5d794e47a58dbfdd258b4beca4263a",
        "version" : "10.9.0"
      }
    },
    {
      "identity" : "googleappmeasurement",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleAppMeasurement.git",
      "state" : {
        "revision" : "9209b95a2593985569918e5e5ee2bf4ef8ff3640",
        "version" : "10.9.0"
      }
    },
    {
      "identity" : "googledatatransport",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleDataTransport.git",
      "state" : {
        "revision" : "7874c1b48cbffd086ce8a052c4be873a78613775",
        "version" : "9.2.3"
      }
    },
    {
      "identity" : "googleutilities",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/GoogleUtilities.git",
      "state" : {
        "revision" : "871d43135925cde39ef7421d8723ce47edfdcc39",
        "version" : "7.11.1"
      }
    },
    {
      "identity" : "grpc-binary",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/grpc-binary.git",
      "state" : {
        "revision" : "df37f6af8a273bc687e3166843ed86007de57d78",
        "version" : "1.44.0"
      }
    },
    {
      "identity" : "gtm-session-fetcher",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/gtm-session-fetcher.git",
      "state" : {
        "revision" : "d415594121c9e8a4f9d79cecee0965cf35e74dbd",
        "version" : "3.1.1"
      }
    },
    {
      "identity" : "leveldb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/leveldb.git",
      "state" : {
        "revision" : "0706abcc6b0bd9cedfbb015ba840e4a780b5159b",
        "version" : "1.22.2"
      }
    },
    {
      "identity" : "nanopb",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/firebase/nanopb.git",
      "state" : {
        "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692",
        "version" : "2.30909.0"
      }
    },
    {
      "identity" : "promises",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/google/promises.git",
      "state" : {
        "revision" : "ec957ccddbcc710ccc64c9dcbd4c7006fcf8b73a",
        "version" : "2.2.0"
      }
    },
    {
      "identity" : "swift-protobuf",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/apple/swift-protobuf.git",
      "state" : {
        "revision" : "0af9125c4eae12a4973fb66574c53a54962a9e1e",
        "version" : "1.21.0"
      }
    }
  ],
  "version" : 2
}


If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

hulk510 avatar Jun 23 '23 09:06 hulk510

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Jun 23 '23 09:06 google-oss-bot

Thanks for raising this. It's a known issue (see https://github.com/firebase/firebase-ios-sdk/issues/9906#issuecomment-1528679012) - we need to implement support for this on the Emulator.

Googlers: see go/firebase-emulator-siwa-token-revocation

peterfriese avatar Jun 23 '23 09:06 peterfriese

Thank you for the update. I appreciate your attention to this matter.

hulk510 avatar Jun 23 '23 11:06 hulk510

👋 is this typical behavior for an iOS simulator as well? trying to determine if I did something wrong thank you!

triage avatar Jul 13 '23 04:07 triage

👋

is this typical behavior for an iOS simulator as well? trying to determine if I did something wrong

thank you!

This is a bug on our end (the Firebase Emulator lacks support for SiwA token revocation), and we're working on a fix.

peterfriese avatar Jul 13 '23 05:07 peterfriese

Hi, I have the same problem. Token revocation doesn't work on the simulator?

eQip123 avatar Jul 27 '23 08:07 eQip123

We're working on it - see https://github.com/firebase/firebase-tools/pull/6050

peterfriese avatar Jul 27 '23 12:07 peterfriese

Would love to see this fix merged.

OskarGroth avatar Oct 04 '23 09:10 OskarGroth

Any update on this? Have you fixed it?

lunax28 avatar Mar 13 '24 11:03 lunax28